Exemplo n.º 1
0
  /** 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());
  }
Exemplo n.º 2
0
  /**
   * 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;
  }
Exemplo n.º 3
0
  /**
   * 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;
  }
Exemplo n.º 4
0
  /**
   * 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;
  }
Exemplo n.º 5
0
  /**
   * 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;
  }
Exemplo n.º 6
0
  @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();
  }