File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,16 @@ public class I18n {
2828 static String PROMPT_OK ;
2929 static String PROMPT_BROWSE ;
3030
31- static protected void init (String language ) {
31+ static protected void init (String language ) throws MissingResourceException {
3232 // there might be a null pointer exception ... most likely will never happen but the jvm gets mad
3333 try {
3434 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 ());
3640 }
37- i18n = ResourceBundle .getBundle ("processing.app.i18n.Resources" , Locale .getDefault ());
38-
3941 PROMPT_YES = _ ("Yes" );
4042 PROMPT_NO = _ ("No" );
4143 PROMPT_CANCEL = _ ("Cancel" );
Original file line number Diff line number Diff line change @@ -267,7 +267,12 @@ static protected void init(String commandLinePrefs) {
267267 }
268268
269269 // 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+ }
271276
272277 // set some other runtime constants (not saved on preferences file)
273278 table .put ("runtime.os" , PConstants .platformNames [PApplet .platform ]);
You can’t perform that action at this time.
0 commit comments