- java.lang.Object
-
- impl.org.controlsfx.i18n.Localization
-
public class Localization extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_PREFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
asKey(String text)
Converts text to localization key, currently by prepending it with the KEY_PREFIXstatic Locale
getLocale()
Returns the Locale object that is associated with ControlsFX.static String
getString(String key)
Returns a string localized using currently set localestatic boolean
isKey(String text)
Checks if the text is a localization keystatic String
localize(String text)
Tries to localize the text.static void
setLocale(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
-
-