Skip to content

Commit b816571

Browse files
committed
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.
1 parent c03ea00 commit b816571

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/src/processing/app/I18n.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public class I18n {
2525
static protected void init (String language) {
2626
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
2727
try {
28-
locale = new Locale(language);
28+
if (language == null || language.trim().isEmpty()) locale = Locale.getDefault();
29+
else locale = new Locale(language);
2930
i18n = ResourceBundle.getBundle("processing.app.Resources", locale);
3031
} catch (java.lang.NullPointerException e) {
3132
}

app/src/processing/app/Preferences.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public class Preferences {
112112

113113
// language related arrays, please read notes later, where the language combo box is introduced
114114
String[] languages = {
115+
_("System Default"),
115116
_("Catalan"),
116117
_("Chinese Simplified"),
117118
_("Chinese Taiwan"),
@@ -133,6 +134,7 @@ public class Preferences {
133134
_("Russian"),
134135
_("Spanish")};
135136
String[] languagesISO = {
137+
"",
136138
"ca",
137139
"zh_cn",
138140
"zh_tw",

0 commit comments

Comments
 (0)