Home java How to write a locale for Russian Zyka?

How to write a locale for Russian Zyka?

Author

Date

Category

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 Russian RU )
  • Country – Country by ISO 3166 (Russia – RU or Rus )

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions