- java.lang.Object
-
- impl.org.controlsfx.i18n.Localization
-
public class Localization extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_PREFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringasKey(String text)Converts text to localization key, currently by prepending it with the KEY_PREFIXstatic LocalegetLocale()Returns the Locale object that is associated with ControlsFX.static StringgetString(String key)Returns a string localized using currently set localestatic booleanisKey(String text)Checks if the text is a localization keystatic Stringlocalize(String text)Tries to localize the text.static voidsetLocale(Locale newLocale)Sets locale which will be used as ControlsFX locale
-
-
-
Field Detail
-
KEY_PREFIX
public static final String KEY_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLocale
public static final Locale getLocale()
Returns the Locale object that is associated with ControlsFX.- Returns:
- the global ControlsFX locale
-
setLocale
public static final void setLocale(Locale newLocale)
Sets locale which will be used as ControlsFX locale- Parameters:
newLocale- null is allowed and will be interpreted as default locale
-
getString
public static final String getString(String key)
Returns a string localized using currently set locale- Parameters:
key- resource bundle key- Returns:
- localized text or formatted key if not found
-
asKey
public static final String asKey(String text)
Converts text to localization key, currently by prepending it with the KEY_PREFIX- Parameters:
text-- Returns:
- localization key
-
isKey
public static final boolean isKey(String text)
Checks if the text is a localization key- Parameters:
text-- Returns:
- true if text is a localization key
-
-