mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
Adding "system default" (default locale) option for IDE language.
That is, if the editor.languages.current preference is empty (or missing), use the default system locale.
This commit is contained in:
parent
c03ea000a2
commit
b816571772
@ -25,7 +25,8 @@ public class I18n {
|
|||||||
static protected void init (String language) {
|
static protected void init (String language) {
|
||||||
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
|
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
|
||||||
try {
|
try {
|
||||||
locale = new Locale(language);
|
if (language == null || language.trim().isEmpty()) locale = Locale.getDefault();
|
||||||
|
else locale = new Locale(language);
|
||||||
i18n = ResourceBundle.getBundle("processing.app.Resources", locale);
|
i18n = ResourceBundle.getBundle("processing.app.Resources", locale);
|
||||||
} catch (java.lang.NullPointerException e) {
|
} catch (java.lang.NullPointerException e) {
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,7 @@ public class Preferences {
|
|||||||
|
|
||||||
// language related arrays, please read notes later, where the language combo box is introduced
|
// language related arrays, please read notes later, where the language combo box is introduced
|
||||||
String[] languages = {
|
String[] languages = {
|
||||||
|
_("System Default"),
|
||||||
_("Catalan"),
|
_("Catalan"),
|
||||||
_("Chinese Simplified"),
|
_("Chinese Simplified"),
|
||||||
_("Chinese Taiwan"),
|
_("Chinese Taiwan"),
|
||||||
@ -133,6 +134,7 @@ public class Preferences {
|
|||||||
_("Russian"),
|
_("Russian"),
|
||||||
_("Spanish")};
|
_("Spanish")};
|
||||||
String[] languagesISO = {
|
String[] languagesISO = {
|
||||||
|
"",
|
||||||
"ca",
|
"ca",
|
||||||
"zh_cn",
|
"zh_cn",
|
||||||
"zh_tw",
|
"zh_tw",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user