From 9a10a22bc3403c495e2fc6e57a8e5a2a4339e56b Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Wed, 2 Oct 2013 17:52:46 +0200 Subject: [PATCH] Renamed resouces boundles he and id to iw and in respectively Removed try catch around i18n.init --- app/src/processing/app/I18n.java | 36 +++++++++---------- ..._id.properties => Resources_in.properties} | 10 +++--- ..._he.properties => Resources_iw.properties} | 0 3 files changed, 21 insertions(+), 25 deletions(-) rename app/src/processing/app/i18n/{Resources_id.properties => Resources_in.properties} (99%) rename app/src/processing/app/i18n/{Resources_he.properties => Resources_iw.properties} (100%) diff --git a/app/src/processing/app/I18n.java b/app/src/processing/app/I18n.java index 21021fa85..6cc2312af 100644 --- a/app/src/processing/app/I18n.java +++ b/app/src/processing/app/I18n.java @@ -31,27 +31,23 @@ public class I18n { static String PROMPT_BROWSE; 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 - try { - String[] languageParts = language.split("_"); - Locale locale = Locale.getDefault(); - // both language and country - if (languageParts.length == 2) { - locale = new Locale(languageParts[0], languageParts[1]); - // just language - } 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) { + String[] languageParts = language.split("_"); + Locale locale = Locale.getDefault(); + // both language and country + if (languageParts.length == 2) { + locale = new Locale(languageParts[0], languageParts[1]); + // just language + } 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"); } public static String _(String s) { diff --git a/app/src/processing/app/i18n/Resources_id.properties b/app/src/processing/app/i18n/Resources_in.properties similarity index 99% rename from app/src/processing/app/i18n/Resources_id.properties rename to app/src/processing/app/i18n/Resources_in.properties index 23f564efd..6a4bc2cf1 100644 --- a/app/src/processing/app/i18n/Resources_id.properties +++ b/app/src/processing/app/i18n/Resources_in.properties @@ -1,8 +1,8 @@ -# Indonesian translations for the Arduino IDE. -# Copyright (C) 2012 -# This file is distributed under the same license as the Arduino IDE package. -# Rininta Andari , 2012. -# +# Indonesian translations for the Arduino IDE. +# Copyright (C) 2012 +# This file is distributed under the same license as the Arduino IDE package. +# Rininta Andari , 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 \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 diff --git a/app/src/processing/app/i18n/Resources_he.properties b/app/src/processing/app/i18n/Resources_iw.properties similarity index 100% rename from app/src/processing/app/i18n/Resources_he.properties rename to app/src/processing/app/i18n/Resources_iw.properties