Class QLocalization

java.lang.Object
com.io7m.quarrel.core.QLocalization
All Implemented Interfaces:
QLocalizationType

public final class QLocalization extends Object implements QLocalizationType
Convenient localization methods.
  • Method Details

    • create

      public static QLocalizationType create(ResourceBundle inInternalResources, ResourceBundle inApplicationResources)
      Create a localizer.
      Parameters:
      inInternalResources - The internal resources
      inApplicationResources - The application-specific resources
      Returns:
      A localizer
    • create

      public static QLocalizationType create(Locale locale, ResourceBundle inApplicationResources)
      Create a localizer.
      Parameters:
      locale - The locale for the internal resources
      inApplicationResources - The application-specific resources
      Returns:
      A localizer
    • create

      public static QLocalizationType create(Locale locale)
      Create a localizer without application-specific resources.
      Parameters:
      locale - The locale for the internal resources
      Returns:
      A localizer
    • localize

      public String localize(QStringType string)
      Description copied from interface: QLocalizationType
      Localize the given string.
      Specified by:
      localize in interface QLocalizationType
      Parameters:
      string - The string
      Returns:
      The string
    • format

      public String format(QStringType string, Object... arguments)
      Description copied from interface: QLocalizationType
      Localize and format the given string. The localized string is treated as a format string, and formatted using MessageFormat.
      Specified by:
      format in interface QLocalizationType
      Parameters:
      string - The string
      arguments - The arguments
      Returns:
      The string