Top Fields Constructors Methods
impl.org.controlsfx.i18n

public Class Localization

extends Object
Class Inheritance
Imports
java.util.Locale, .MissingResourceException, .ResourceBundle

Field Summary

Modifier and TypeField and Description
public static final String
private static Locale
private static final String
private static ResourceBundle
private static Locale

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static final String

Returns:

localization key
asKey
(String text)

Converts text to localization key, currently by prepending it with the KEY_PREFIX

public static final Locale

Returns:

the global ControlsFX locale
getLocale
()

Returns the Locale object that is associated with ControlsFX.

private static final synchronized ResourceBundle
public static final String

Returns:

localized text or formatted key if not found
getString
(final String
resource bundle key
key
)

Returns a string localized using currently set locale

public static final boolean

Returns:

true if text is a localization key
isKey
(String text)

Checks if the text is a localization key

public static String
localize(String text)

Tries to localize the text.

public static final void
setLocale(final Locale
null is allowed and will be interpreted as default locale
newLocale
)

Sets locale which will be used as ControlsFX locale

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

KEY_PREFIXback to summary
public static final String KEY_PREFIX
localeback to summary
private static Locale locale
LOCALE_BUNDLE_NAMEback to summary
private static final String LOCALE_BUNDLE_NAME
resourceBundleback to summary
private static ResourceBundle resourceBundle
resourceBundleLocaleback to summary
private static Locale resourceBundleLocale

Constructor Detail

Localizationback to summary
private Localization()

Method Detail

asKeyback to summary
public static final String asKey(String text)

Converts text to localization key, currently by prepending it with the KEY_PREFIX

Returns:String

localization key

getLocaleback to summary
public static final Locale getLocale()

Returns the Locale object that is associated with ControlsFX.

Returns:Locale

the global ControlsFX locale

getLocaleBundleback to summary
private static final synchronized ResourceBundle getLocaleBundle()
getStringback to summary
public static final String getString(final String key)

Returns a string localized using currently set locale

Parameters
key:String

resource bundle key

Returns:String

localized text or formatted key if not found

isKeyback to summary
public static final boolean isKey(String text)

Checks if the text is a localization key

Returns:boolean

true if text is a localization key

localizeback to summary
public static String localize(String text)

Tries to localize the text. If the text is a localization key - and attempt will be made to use it for localization, otherwise the text is returned as is

setLocaleback to summary
public static final void setLocale(final Locale newLocale)

Sets locale which will be used as ControlsFX locale

Parameters
newLocale:Locale

null is allowed and will be interpreted as default locale