java.lang.Object
io.github.jbastgen.stemma.app.i18n.I18n

public final class I18n extends Object
The language of the user interface (feature 9). Texts are looked up by their English wording: I18n.t("Pull") gives the text of the chosen language, and the English text itself when the language has none, so a missing translation is never a problem. The texts are in /i18n/<code>.tsv (UTF-8, English TAB translation); en.tsv lists the keys.
  • Method Details

    • languages

      public static List<I18n.Language> languages()
      The languages Stemma has, English first.
    • flag

      public static javafx.scene.image.Image flag(String code)
      The picture of the flag of a language (system gives a globe), 48 x 32 pixels, or null when there is none. Pictures are used because JavaFX cannot draw the emoji flags (they show as two letters); see app/tools/make_flags.py.
    • resolve

      public static String resolve(String setting, Locale system)
      The language to use for a setting: a code, or empty for the language of the system (English when Stemma has none).
    • setLanguage

      public static void setLanguage(String code)
      Switches the language; takes effect for the texts made from now on.
    • language

      public static String language()
      The code of the language in use.
    • t

      public static String t(String english)
      The text in the chosen language; the English text when there is none.
    • n

      public static String n(long count, String one, String other, Object... args)
      The singular text when count is 1, else the plural text; both are looked up and filled in like t(java.lang.String).
    • t

      public static String t(String english, Object... args)
      Like t(java.lang.String) with {0}, {1} … replaced by the arguments.