1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

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 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) {