Class TranslationService

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 Details

  • Method Details

    • translate

      public abstract String translate​(String key)
      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

      public void addListener​(Runnable listener)
    • removeListener

      public void removeListener​(Runnable listener)
    • notifyListeners

      protected void notifyListeners()
      Notifies all listeners of a locale change. Concrete implementations must call this method after every locale change.