java.lang.Object
com.cryptoalgo.oursql.support.I18N
Utility class for all things localisation
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable String
getHumanReadableNameFor
(String localeCode) Lookup the human-readable name of a language given its locale codestatic @Nullable String
getLocaleCodeFor
(String humanReadableName) Get the locale code of a human-readable language namestatic String[]
Get the locale codes names of supported languagesstatic String
Get a localised string from the bundle, optionally substituting values into the template.
-
Field Details
-
BUNDLE_NAME
Name of the localisation bundle- See Also:
-
-
Constructor Details
-
I18N
public I18N()
-
-
Method Details
-
getLocales
Get the locale codes names of supported languages- Returns:
- A string array containing locale codes of the supported languages
-
getHumanReadableNameFor
Lookup the human-readable name of a language given its locale code- Parameters:
localeCode
- Locale code to lookup- Returns:
- The human-readable name of the language, null if not found
-
getLocaleCodeFor
Get the locale code of a human-readable language name- Parameters:
humanReadableName
- Human-readable language name to lookup- Returns:
- The locale code of the language, null if not found
-
getString
Get a localised string from the bundle, optionally substituting values into the template.- Parameters:
key
- Localisation key, as present in the bundlevalues
- Values to substitute- Returns:
- Localised string
-