Class I18N

java.lang.Object
marauroa.common.i18n.I18N

public class I18N extends Object
internationalization support
Author:
hendrik
  • Constructor Details

    • I18N

      public I18N()
  • Method Details

    • init

      public static void init(Locale locale)
      initialize the I18N system
      Parameters:
      locale - default locale
    • addDictionaryFolder

      public static void addDictionaryFolder(String folder)
      adds a dictionary folder, so that games can make use of the same translation meachnism
      Parameters:
      folder - classpath folder to add
    • setThreadLocale

      public static void setThreadLocale(Locale locale)
      sets the locale for this thread
      Parameters:
      locale - locale to set
    • resetThreadLocale

      public static void resetThreadLocale()
      resets the locale for this thread
    • getLocale

      public static Locale getLocale()
      gets the locale for this thread
      Returns:
      locale
    • translate

      public static String translate(String key, Object... args)
      translates the text to the thread language
      Parameters:
      key - text to translate
      args - optional arguments
      Returns:
      translated text