Package com.rvandoosselaer.jmeutils.gui
Class GuiTranslations
- java.lang.Object
-
- com.rvandoosselaer.jmeutils.gui.GuiTranslations
-
public class GuiTranslations extends java.lang.ObjectA 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 thet(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 GuiTranslationsgetInstance()java.lang.Stringt(java.lang.String key)Retrieves the value of the given key from the resource bundle.java.lang.Stringt(java.lang.String key, java.lang.Object... params)Retrieves the value of the given key from the resource bundle.
-
-
-
Method Detail
-
getInstance
public static GuiTranslations getInstance()
-
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 forparams- the params to insert in the key- Returns:
- the string for the given key
-
-