Windows

It should obtain the active language on most recent (NT and higher) versions. If not, please submit Github issue with your version of Windows and a way to detect the language.

On most (?) Windows, we can get the LocaleName by reading the registry. The output of the command run below looks like

HKEY_CURRENT_USER\Control Panel\International
       Locale    REG_SZ    00000409
       LocaleName    REG_SZ    en-US
       […]

According to Window's docs, it is possible for Windows to be run "regionless" but I'm not sure how that would work. The region code is "-" in that theoretical case.

For later versions of Windows, it is possible to get an ordered list of languages. As with the Linux code, the first attempt is to get an ordered list. If that fails, then the more fool-proof LocaleName will be used.

User::Language v0.5.0

A simple module for obtaining the user’s preferred language(s)

Authors

  • Matthew ‘Matéu’ Stephen STUCKWISCH

License

Artistic-2.0

Dependencies

Intl::LanguageTag:auth:<zef:guifa>:ver<0.12.1+>

Test Dependencies

Provides

  • Intl::UserLanguage
  • User::Language
  • User::Language::Linux
  • User::Language::Mac
  • User::Language::Windows

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.