java.lang.Object
com.cryptoalgo.oursql.support.I18N

public final class I18N extends Object
Utility class for all things localisation
  • Field Details

  • Constructor Details

    • I18N

      public I18N()
  • Method Details

    • getLocales

      public static String[] getLocales()
      Get the locale codes names of supported languages
      Returns:
      A string array containing locale codes of the supported languages
    • getHumanReadableNameFor

      @Nullable public static @Nullable String getHumanReadableNameFor(String localeCode)
      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

      @Nullable public static @Nullable String getLocaleCodeFor(String humanReadableName)
      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

      public static String getString(String key, Object... values)
      Get a localised string from the bundle, optionally substituting values into the template.
      Parameters:
      key - Localisation key, as present in the bundle
      values - Values to substitute
      Returns:
      Localised string