public final class LanguageSelection extends Observable
| Modifier and Type | Class and Description |
|---|---|
static interface |
LanguageSelection.OnLanguageChangeListener |
| Modifier and Type | Method and Description |
|---|---|
static void |
addObserverFor(String identifier,
Consumer<String> newTextConsumer)
Adds an Listener to the given identifier.
|
static void |
addObserverFor(String identifier,
LanguageSelection.OnLanguageChangeListener onLanguageChangeListener)
Adds an Listener to the given identifier.
|
static LanguageSelection |
getInstance()
Singleton Pattern.
|
static String |
getLocalized(String identifier)
Retunrns the localized text for the given identifier.
|
static String |
getLocalized(String identifier,
Object... args)
Returns the localized text for the given identifier and replaces placeholder like
{0} with given
arguments. |
static javafx.beans.property.ReadOnlyStringProperty |
getProperty(String identifier)
Returns an Observable Property which contains the localized string for the given identifier.
|
void |
setSelectedLocale(Locale selectedLocale)
Setter method to allow changing the language and notifying all gui elements to adapt afterwards.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedpublic static LanguageSelection getInstance()
public void setSelectedLocale(Locale selectedLocale)
selectedLocale - the new locale which should be set as default.public static String getLocalized(String identifier)
identifier - the identifierpublic static String getLocalized(String identifier, Object... args)
{0} with given
arguments.identifier - the identifierargs - the placeholder-argumentspublic static void addObserverFor(String identifier, LanguageSelection.OnLanguageChangeListener onLanguageChangeListener)
identifier - the identifieronLanguageChangeListener - the listener for this identifierpublic static void addObserverFor(String identifier, Consumer<String> newTextConsumer)
identifier - the identifiernewTextConsumer - the listener for this identifierpublic static javafx.beans.property.ReadOnlyStringProperty getProperty(String identifier)
identifier - the identifierCopyright © 2015–2018 openbase.org. All rights reserved.