Exemple #1
0
  protected void initializeMenuItems(final MenuManagerServices menuServices) {

    MenuItem fileMenuItem = new MenuItem(Translator.tr("menu.file.exit"));
    fileMenuItem.setOnAction(
        e -> {
          ComponentManager.componentManager.stopApplication();
          System.exit(0);
        });
    menuServices.addMenuItem(DefaultMenuEnum.FILE, fileMenuItem);

    MenuItem preferenceMenuItem = new MenuItem(Translator.tr("menu.edit.preferences"));
    preferenceMenuItem.setOnAction(e -> optionsManagerServices.show());

    menuServices.addMenuItem(DefaultMenuEnum.EDIT, preferenceMenuItem);
  }
Exemple #2
0
  public static String tr(String key) {

    if (instance == null) {
      instance = new Translator();
    }

    return instance._tr(key);
  }
Exemple #3
0
  public static void setLang(I18nLangEnum lang) {

    if (instance == null) {
      instance = new Translator();
    }

    instance._setLang(lang);
  }