(String language)
| 51 | public static String PROMPT_BROWSE; |
| 52 | |
| 53 | static protected void init(String language) throws MissingResourceException { |
| 54 | String[] languageParts = language.split("_"); |
| 55 | Locale locale = Locale.getDefault(); |
| 56 | // both language and country |
| 57 | if (languageParts.length == 2) { |
| 58 | locale = new Locale(languageParts[0], languageParts[1]); |
| 59 | // just language |
| 60 | } else if (languageParts.length == 1 && !"".equals(languageParts[0])) { |
| 61 | locale = new Locale(languageParts[0]); |
| 62 | } |
| 63 | // there might be a null pointer exception ... most likely will never happen but the jvm gets mad |
| 64 | Locale.setDefault(locale); |
| 65 | i18n = ResourceBundle.getBundle("processing.app.i18n.Resources", Locale.getDefault()); |
| 66 | PROMPT_YES = tr("Yes"); |
| 67 | PROMPT_NO = tr("No"); |
| 68 | PROMPT_CANCEL = tr("Cancel"); |
| 69 | PROMPT_OK = tr("OK"); |
| 70 | PROMPT_BROWSE = tr("Browse"); |
| 71 | } |
| 72 | |
| 73 | public static String tr(String s) { |
| 74 | String res; |
no test coverage detected