Ok. That block uses the following code:
openfl.system.Capabilities.language
Here's a link to the documentation for that property:
openfl.system.Capabilities.languageAnd here's a copy of the documentation:
/**
Specifies the language code of the system on which the content is
running. The language is specified as a lowercase two-letter language
code from ISO 639-1. For Chinese, an additional uppercase two-letter
country code from ISO 3166 distinguishes between Simplified and
Traditional Chinese. The languages codes are based on the English
names of the language: for example, `hu` specifies Hungarian.
On English systems, this property returns only the language code
(`en`), not the country code. On Microsoft Windows systems, this
property returns the user interface (UI) language, which refers to the
language used for all menus, dialog boxes, error messages, and help
files. The following table lists the possible values:
| Language | Value |
| --- | --- |
| Czech | `cs` |
| Danish | `da` |
| Dutch | `nl` |
| English | `en` |
| Finnish | `fi` |
| French | `fr` |
| German | `de` |
| Hungarian | `hu` |
| Italian | `it` |
| Japanese | `ja` |
| Korean | `ko` |
| Norwegian | `no` |
| Other/unknown | `xu` |
| Polish | `pl` |
| Portuguese | `pt` |
| Russian | `ru` |
| Simplified Chinese | `zh-CN` |
| Spanish | `es` |
| Swedish | `sv` |
| Traditional Chinese | `zh-TW` |
| Turkish | `tr` |
_Note:_ The value of `Capabilities.language` property is limited to
the possible values on this list. Because of this limitation, Adobe
AIR applications should use the first element in the
`Capabilities.languages` array to determine the primary user interface
language for the system.
The server string is `L`.
**/
public static var language(get, never):String;
Unfortunately, I guess the return value of "xu" is this working as intended.
If we take a look at how language is determined, we can see that it's doing this under the hood:
@:noCompletion private static function get_language():String
{
#if lime
var language = Locale.currentLocale.language;
if (language != null)
{
language = language.toLowerCase();
switch (language)
{
case "cs", "da", "nl", "en", "fi", "fr", "de", "hu", "it", "ja", "ko", "nb", "pl", "pt", "ru", "es", "sv", "tr":
return language;
case "zh":
var region = Locale.currentLocale.region;
if (region != null)
{
switch (region.toUpperCase())
{
case "TW", "HANT":
return "zh-TW";
default:
}
}
return "zh-CN";
default:
return "xu";
}
}
#end
return "en";
}
Looks like the answer lies with
lime.system.Locale.currentLocale.language and
lime.system.Locale.currentLocale.region.
Perhaps you can try putting those into a code block and see if they give you what you want.