Skip to content

Commit 1898f5d

Browse files
committed
Enable input method support by default on Japanese/Korean/Chinese systems
1 parent 030ff8e commit 1898f5d

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

app/src/processing/app/Language.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,18 @@ static public String getLanguage() {
236236
}
237237

238238

239+
/**
240+
* Is this a CJK language where Input Method support is suggested/required?
241+
* @return true if the user is running in Japanese, Korean, or Chinese
242+
*/
243+
static public boolean useInputMethod() {
244+
final String language = getLanguage();
245+
return (language.equals("ja") ||
246+
language.equals("ko") ||
247+
language.equals("zh"));
248+
}
249+
250+
239251
// /** Set new language (called by Preferences) */
240252
// static public void setLanguage(String language) {
241253
// this.language = language;

app/src/processing/app/Preferences.java

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,36 +71,18 @@ static public void init() {
7171
"You'll need to reinstall Processing.", e);
7272
}
7373

74-
/* provisionally removed in 3.0a6, see changes in load()
75-
76-
// check for platform-specific properties in the defaults
77-
String platformExt = "." + PConstants.platformNames[PApplet.platform]; //$NON-NLS-1$
78-
int platformExtLength = platformExt.length();
79-
80-
// Get a list of keys that are specific to this platform
81-
ArrayList<String> platformKeys = new ArrayList<String>();
82-
for (String key : table.keySet()) {
83-
if (key.endsWith(platformExt)) {
84-
platformKeys.add(key);
85-
}
86-
}
87-
88-
// Use those platform-specific keys to override
89-
for (String key : platformKeys) {
90-
// this is a key specific to a particular platform
91-
String actualKey = key.substring(0, key.length() - platformExtLength);
92-
String value = get(key);
93-
set(actualKey, value);
94-
}
95-
*/
96-
9774
// Clone the defaults, then override any them with the user's preferences.
9875
// This ensures that any new/added preference will be present.
9976
defaults = new HashMap<String, String>(table);
10077

10178
// other things that have to be set explicitly for the defaults
10279
setColor("run.window.bgcolor", SystemColor.control); //$NON-NLS-1$
10380

81+
// For CJK users, enable IM support by default
82+
if (Language.useInputMethod()) {
83+
setBoolean("editor.input_method_support", true);
84+
}
85+
10486
// next load user preferences file
10587
preferencesFile = Base.getSettingsFile(PREFS_FILE);
10688
boolean firstRun = !preferencesFile.exists();

todo.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
0252 (3.1.3?)
2+
X Enable input method support by default on Japanese/Korean/Chinese systems
3+
X https://github.com/processing/processing/pull/4598
4+
25
_ modify line number color when no lines extend that far?
36
_ https://github.com/processing/processing/pull/4560
47
_ text gutter doesn't seem to be hidpi

0 commit comments

Comments
 (0)