Package com.e1c.langtool.external
Class LocaleUtils
java.lang.Object
com.e1c.langtool.external.LocaleUtils
This class contains useful language codes and some static utility methods
for working with locales based on string.
-
Field Summary
Fields -
Method Summary
-
Field Details
-
ENGLISH
- See Also:
-
RUSSIAN
- See Also:
-
GERMAN
- See Also:
-
FRENCH
- See Also:
-
ITALIAN
- See Also:
-
-
Method Details
-
getCode
Returns the language code from the given locale.If format of the locale is wrong and doesn't contain separator between language code and region code (
'-'is used as separator) this method returns the given locale.- Parameters:
locale- the locale which consists of language code and some other parts (for example - region:en-US)- Returns:
- the language code
-
getRegion
Returns the region code from the given locale.If format of the locale is wrong and doesn't contain separator between language code and region code (
'-'is used as separator) this method returns the given locale.- Parameters:
locale- the locale which consists of language code and some other parts (for example - region:en-US)- Returns:
- the region code
-