Class GuiTranslations


  • public class GuiTranslations
    extends java.lang.Object
    A singleton implementation that loads a 'translations/gui' resource bundle to retrieve translated values based on a key. The language can be specified using the 'user.language' property. eg. -Duser.language=en will look for the 'translations/gui_en.properties' file. When a key isn't found in the resource bundle when it's retrieved using the t(String) method, the value of the key itself will be returned.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static GuiTranslations getInstance()  
      java.lang.String t​(java.lang.String key)
      Retrieves the value of the given key from the resource bundle.
      java.lang.String t​(java.lang.String key, java.lang.Object... params)
      Retrieves the value of the given key from the resource bundle.
      • Methods inherited from class java.lang.Object

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

      • t

        public java.lang.String t​(java.lang.String key)
        Retrieves the value of the given key from the resource bundle.
        Parameters:
        key - : key to look for
        Returns:
        the string for the given key in the resource bundle or the key itself when the key isn't found
      • t

        public java.lang.String t​(java.lang.String key,
                                  java.lang.Object... params)
        Retrieves the value of the given key from the resource bundle. Parameters can be supplied, these parameters will be camelcased and inserted in the given key. eg. t("button.{0}.{1}.title", "Hello World", "foo") will look for key: "button.helloWorld.foo.title" in the given key String
        Parameters:
        key - the key to look for
        params - the params to insert in the key
        Returns:
        the string for the given key