Renamed resouces boundles he and id to iw and in respectively

Removed try catch around i18n.init
This commit is contained in:
Federico Fissore 2013-10-02 17:52:46 +02:00
parent 8028cc38e7
commit 9a10a22bc3
3 changed files with 21 additions and 25 deletions

View File

@ -31,27 +31,23 @@ public class I18n {
static String PROMPT_BROWSE; static String PROMPT_BROWSE;
static protected void init(String language) throws MissingResourceException { static protected void init(String language) throws MissingResourceException {
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad String[] languageParts = language.split("_");
try { Locale locale = Locale.getDefault();
String[] languageParts = language.split("_"); // both language and country
Locale locale = Locale.getDefault(); if (languageParts.length == 2) {
// both language and country locale = new Locale(languageParts[0], languageParts[1]);
if (languageParts.length == 2) { // just language
locale = new Locale(languageParts[0], languageParts[1]); } else if (languageParts.length == 1 && !"".equals(languageParts[0])) {
// just language locale = new Locale(languageParts[0]);
} else if (languageParts.length == 1 && !"".equals(languageParts[0])) {
locale = new Locale(languageParts[0]);
}
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
Locale.setDefault(locale);
i18n = ResourceBundle.getBundle("processing.app.i18n.Resources", Locale.getDefault());
PROMPT_YES = _("Yes");
PROMPT_NO = _("No");
PROMPT_CANCEL = _("Cancel");
PROMPT_OK = _("OK");
PROMPT_BROWSE = _("Browse");
} catch (java.lang.NullPointerException e) {
} }
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
Locale.setDefault(locale);
i18n = ResourceBundle.getBundle("processing.app.i18n.Resources", Locale.getDefault());
PROMPT_YES = _("Yes");
PROMPT_NO = _("No");
PROMPT_CANCEL = _("Cancel");
PROMPT_OK = _("OK");
PROMPT_BROWSE = _("Browse");
} }
public static String _(String s) { public static String _(String s) {

View File

@ -1,8 +1,8 @@
# Indonesian translations for the Arduino IDE. # Indonesian translations for the Arduino IDE.
# Copyright (C) 2012 # Copyright (C) 2012
# This file is distributed under the same license as the Arduino IDE package. # This file is distributed under the same license as the Arduino IDE package.
# Rininta Andari <mail@rininta-andari.de>, 2012. # Rininta Andari <mail@rininta-andari.de>, 2012.
# #
!=Project-Id-Version\: Arduino IDE 1.5\nReport-Msgid-Bugs-To\: \nPOT-Creation-Date\: 2012-03-29 10\:24-0400\nPO-Revision-Date\: 2013-09-10 10\:35+0000\nLast-Translator\: cmaglie <c.maglie@arduino.cc>\nLanguage-Team\: Indonesian (http\://www.transifex.com/projects/p/arduino-ide-15/language/id/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: id\nPlural-Forms\: nplurals\=1; plural\=0;\n !=Project-Id-Version\: Arduino IDE 1.5\nReport-Msgid-Bugs-To\: \nPOT-Creation-Date\: 2012-03-29 10\:24-0400\nPO-Revision-Date\: 2013-09-10 10\:35+0000\nLast-Translator\: cmaglie <c.maglie@arduino.cc>\nLanguage-Team\: Indonesian (http\://www.transifex.com/projects/p/arduino-ide-15/language/id/)\nMIME-Version\: 1.0\nContent-Type\: text/plain; charset\=UTF-8\nContent-Transfer-Encoding\: 8bit\nLanguage\: id\nPlural-Forms\: nplurals\=1; plural\=0;\n
#: Preferences.java:358 Preferences.java:374 #: Preferences.java:358 Preferences.java:374