Class I18nContext

java.lang.Object
org.pdfsam.i18n.I18nContext

public final class I18nContext extends Object
Context to deal with translations. It contains information about the mutable current locale and allow to translate strings to the current locale through static methods.
Author:
Andrea Vacondio
  • Method Details

    • setLocale

      @EventListener public void setLocale(SetLocaleRequest e)
    • i18n

      public static I18nContext i18n()
      Returns:
      the default I18nContext instance
    • locale

      public javafx.beans.value.ObservableValue<Locale> locale()
      Returns:
      an ObservableValue Locale representing the current locale
    • tr

      public String tr(String text)
    • tr

      public String tr(String text, String... replace)
      Parameters:
      text - text to be translated
      replace - replacements for the placeholders
      Returns:
      the translated string where {0} and {1} (etc) placeholders are replaced by the replace[0], replace[1] etc
    • getSupported

      public Set<Locale> getSupported()