Class ResourceBundleInternationalization

java.lang.Object
dev.voidframework.i18n.ResourceBundleInternationalization
All Implemented Interfaces:
Internationalization

public final class ResourceBundleInternationalization extends Object implements Internationalization
Resource bundle based internationalization.
Since:
1.0.0
  • Constructor Details

    • ResourceBundleInternationalization

      public ResourceBundleInternationalization()
      Build a new instance.
      Since:
      1.0.0
  • Method Details

    • getMessage

      public String getMessage(Locale locale, String key)
      Description copied from interface: Internationalization
      Retrieves a message.
      Specified by:
      getMessage in interface Internationalization
      Parameters:
      locale - The locale corresponding to the translation to be used
      key - The message key
      Returns:
      The message, otherwise, a String containing the message key surrounded with "%"
    • getMessage

      public String getMessage(Locale locale, String key, Object... argumentArray)
      Description copied from interface: Internationalization
      Retrieves a message.
      Specified by:
      getMessage in interface Internationalization
      Parameters:
      locale - The locale corresponding to the translation to be used
      key - The message key
      argumentArray - The message arguments
      Returns:
      The message, otherwise, a String containing the message key surrounded with "%"
    • getMessage

      public String getMessage(Locale locale, long quantity, String key, Object... argumentArray)
      Description copied from interface: Internationalization
      Retrieves a message.
      Specified by:
      getMessage in interface Internationalization
      Parameters:
      locale - The locale corresponding to the translation to be used
      quantity - The quantity to determine the plural key to use
      key - The message key
      argumentArray - The message arguments
      Returns:
      The message, otherwise, a String containing the message key surrounded with "%"
    • getAllMessages

      public Map<String,String> getAllMessages(Locale locale)
      Description copied from interface: Internationalization
      Retrieves all messages with linked key.
      Specified by:
      getAllMessages in interface Internationalization
      Parameters:
      locale - The locale
      Returns:
      A Map containing all messages with linked key