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); }
public static String tr(String key) { if (instance == null) { instance = new Translator(); } return instance._tr(key); }
public static void setLang(I18nLangEnum lang) { if (instance == null) { instance = new Translator(); } instance._setLang(lang); }