java.lang.Object
com.dlsc.formsfx.model.util.TranslationService
com.dlsc.formsfx.model.util.ResourceBundleService
public class ResourceBundleService extends TranslationService
The ResourceBundleService is a concrete implementation of a
TranslationService and uses ResourceBundles to perform translations.- Author:
- Sacha Schmid, Rinesch Murugathas
-
Constructor Summary
Constructors Constructor Description ResourceBundleService(ResourceBundle rb) -
Method Summary
Modifier and Type Method Description voidchangeLocale(ResourceBundle newValue)Change the resource bundle to use for this service.Stringtranslate(String key)Looks up a key in the translation service and returns the translate string.Methods inherited from class com.dlsc.formsfx.model.util.TranslationService
addListener, notifyListeners, removeListener
-
Constructor Details
-
Method Details
-
changeLocale
Change the resource bundle to use for this service. Notifies all listeners of the locale change.- Parameters:
newValue- The new resource bundle to use for translations.
-
translate
Looks up a key in the translation service and returns the translate string.- Specified by:
translatein classTranslationService- Parameters:
key- The key to use for the lookup.- Returns:
- The translated string.
-