/** Ladataan nykyinen kieli. * */ public void load(Preferences preferences) { if (preferences.contains("Locale")) currentLocaleIndex = preferences.getInteger("Locale"); else currentLocaleIndex = 0; languageBundle = I18NBundle.createBundle(Gdx.files.internal("Resources\\strings"), getCurrentLocale()); }
/** * Returns I18N bundle used by ColorPicker, if current bundle is null, a default bundle is set and * returned */ public static I18NBundle getColorPickerBundle() { if (colorPickerBundle == null) { FileHandle file = Gdx.files.classpath("com/kotcrab/vis/ui/i18n/ColorPicker"); colorPickerBundle = I18NBundle.createBundle(file, new Locale("en")); } return colorPickerBundle; }
/** * Returns I18N bundle used by TabbedPane, if current bundle is null, a default bundle is set and * returned */ public static I18NBundle getTabbedPaneBundle() { if (tabbedPaneBundle == null) { FileHandle file = Gdx.files.classpath("com/kotcrab/vis/ui/i18n/TabbedPane"); tabbedPaneBundle = I18NBundle.createBundle(file, new Locale("en")); } return tabbedPaneBundle; }
/** * Returns I18N bundle used by DialogUtils, if current bundle is null, a default bundle is set and * returned */ public static I18NBundle getDialogUtilsBundle() { if (dialogUtilsBundle == null) { FileHandle file = Gdx.files.classpath("com/kotcrab/vis/ui/i18n/DialogUtils"); dialogUtilsBundle = I18NBundle.createBundle(file, new Locale("en")); } return dialogUtilsBundle; }
/** * Returns I18N bundle used by FileChooser, if current bundle is null, a default bundle is set and * returned */ public static I18NBundle getFileChooserBundle() { if (fileChooserBundle == null) { FileHandle file = Gdx.files.classpath("com/kotcrab/vis/ui/i18n/FileChooser"); fileChooserBundle = I18NBundle.createBundle(file, new Locale("en")); } return fileChooserBundle; }
@Override public void notifyLanguageChanged() { // Gdx.app.log("LANGDBG", "Notifying, locale: " + getCurrentLocale()); languageBundle = I18NBundle.createBundle(Gdx.files.internal("Resources\\strings"), getCurrentLocale()); // Gdx.app.log("LANGDBG", "Notifying, lang: " + languageBundle.getLocale()); for (LanguageObserver observer : observerList) observer.updateLanguage(); }