Interface LocalizedBundle


public interface LocalizedBundle
This class use ICU message format for handling of localized text, you can get info about it here: MessageFormat, icu-user guide
  • Method Summary

    Modifier and Type
    Method
    Description
     
    In localization file you should write keys for variables like this: <key>=<text>
    default String
    getString(String key, Object... arguments)
    In localization file you should write keys for variables like this: <key>=<text>
    getString(String key, Map<String,Object> arguments)
    In localization file you should write keys for variables like this: <key>=<text>
    com.ibm.icu.util.ULocale
     
  • Method Details

    • getString

      String getString(String key)
      In localization file you should write keys for variables like this: <key>=<text>
      Parameters:
      key -
      Returns:
      localized text for current locale
      Throws:
      NullPointerException - if key is null
      MissingResourceException - if no object for the given key can be found
      ClassCastException - if the object found for the given key is not a string
    • getString

      String getString(String key, Map<String,Object> arguments)
      In localization file you should write keys for variables like this: <key>=<text>
      Parameters:
      key -
      arguments - that should be inserted in text.
      Returns:
      localized text for current locale
      Throws:
      NullPointerException - if key is null
      MissingResourceException - if no object for the given key can be found
      ClassCastException - if the object found for the given key is not a string
    • getString

      default String getString(String key, Object... arguments)
      In localization file you should write keys for variables like this: <key>=<text>
      Parameters:
      key -
      arguments - array of key-value pairs
      Returns:
      localized text for current locale
      Throws:
      NullPointerException - if key is null
      MissingResourceException - if no object for the given key can be found
      ClassCastException - if the object found for the given key is not a string
    • getLocale

      Locale getLocale()
      Returns:
      Locale that this bundle use
    • getULocale

      com.ibm.icu.util.ULocale getULocale()
      Returns:
      Locale that this bundle use