java.lang.Object
com.dlsc.formsfx.model.util.TranslationService
- Direct Known Subclasses:
ResourceBundleService
public abstract class TranslationService extends Object
A general purpose translation service that is used to translate values into
multiple locales based on keys. A concrete sample implementation is provided
in the
ResourceBundleService.- Author:
- Sacha Schmid, Rinesch Murugathas
-
Constructor Summary
Constructors Constructor Description TranslationService() -
Method Summary
Modifier and Type Method Description voidaddListener(Runnable listener)protected voidnotifyListeners()Notifies all listeners of a locale change.voidremoveListener(Runnable listener)abstract Stringtranslate(String key)Looks up a key in the translation service and returns the translate string.
-
Constructor Details
-
TranslationService
public TranslationService()
-
-
Method Details
-
translate
Looks up a key in the translation service and returns the translate string.- Parameters:
key- The key to use for the lookup.- Returns:
- The translated string.
-
addListener
-
removeListener
-
notifyListeners
protected void notifyListeners()Notifies all listeners of a locale change. Concrete implementations must call this method after every locale change.
-