Class I18n


  • public class I18n
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      I18n()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Locale getCurrentLocale()  
      static java.lang.String register​(java.lang.String template)
      Register a template key and return it.
      static void setCurrentLocale​(java.util.Locale locale)  
      static java.lang.String t​(java.lang.String input, java.lang.Object... args)
      Translate the given string with the given input to the desired language
      static java.lang.String t​(java.lang.String input, java.util.Locale locale, java.lang.Object... args)
      Translate the given string with the given input to the desired language
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • I18n

        public I18n()
    • Method Detail

      • t

        public static java.lang.String t​(java.lang.String input,
                                         java.lang.Object... args)
        Translate the given string with the given input to the desired language
        Parameters:
        input -
        args -
        Returns:
      • t

        public static java.lang.String t​(java.lang.String input,
                                         java.util.Locale locale,
                                         java.lang.Object... args)
        Translate the given string with the given input to the desired language
        Parameters:
        input -
        args -
        Returns:
      • register

        public static java.lang.String register​(java.lang.String template)
        Register a template key and return it. Useful mostly when you want to translate enum constants - for normal translation you will likely want to use the t method from this class This method does not do anything, but the gettext scanner recognizes it and adds it to the resource bundles
        Parameters:
        template -
        Returns:
      • setCurrentLocale

        public static void setCurrentLocale​(java.util.Locale locale)
      • getCurrentLocale

        public static java.util.Locale getCurrentLocale()