File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,16 @@ public class I18n {
28
28
static String PROMPT_OK ;
29
29
static String PROMPT_BROWSE ;
30
30
31
- static protected void init (String language ) {
31
+ static protected void init (String language ) throws MissingResourceException {
32
32
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
33
33
try {
34
34
if (language != null && language .trim ().length () > 0 ) {
35
- Locale .setDefault (new Locale (language ));
35
+ Locale locale = new Locale (language );
36
+ i18n = ResourceBundle .getBundle ("processing.app.i18n.Resources" , locale );
37
+ Locale .setDefault (locale );
38
+ } else {
39
+ i18n = ResourceBundle .getBundle ("processing.app.i18n.Resources" , Locale .getDefault ());
36
40
}
37
- i18n = ResourceBundle .getBundle ("processing.app.i18n.Resources" , Locale .getDefault ());
38
-
39
41
PROMPT_YES = _ ("Yes" );
40
42
PROMPT_NO = _ ("No" );
41
43
PROMPT_CANCEL = _ ("Cancel" );
Original file line number Diff line number Diff line change @@ -267,7 +267,12 @@ static protected void init(String commandLinePrefs) {
267
267
}
268
268
269
269
// load the I18n module for internationalization
270
- I18n .init (Preferences .get ("editor.languages.current" ));
270
+ try {
271
+ I18n .init (Preferences .get ("editor.languages.current" ));
272
+ } catch (MissingResourceException e ) {
273
+ I18n .init ("" );
274
+ Preferences .set ("editor.languages.current" , "" );
275
+ }
271
276
272
277
// set some other runtime constants (not saved on preferences file)
273
278
table .put ("runtime.os" , PConstants .platformNames [PApplet .platform ]);
You can’t perform that action at this time.
0 commit comments