Question on the localization of the project. I can write Locale.uk
, locale.france
, but you can not write Locale.ru
. How to write Locale
for Russian Zyanka?
Part of the code:
resourcebundle bundle;
Locale Locale;
Language = input.nextint ();
Switch (Language) {
Case 1:
Locale = Locale.us;
Break;
Case 2:
Locale = Locale.Russian;
Break;
}
System.out.PrintLN (Bundle.getString ("Languages"));
Answer 1, Authority 100%
Constants in Locale
There are not for all languages / countries.
There are several ways to create a locale for other combinations. See for example here .
One option is to use one of the available constructors:
locale (String Language)
Locale (String Language, String Country)
Locale (String Language, String Country, String Variant)
Here:
Language
– this is 2 or 3rd letter code ISO 639 (for RussianRU
)Country
– Country by ISO 3166 (Russia –RU
orRus
)