MCPcopy
hub / github.com/arduino/Arduino / init

Method init

arduino-core/src/processing/app/I18n.java:53–71  ·  view source on GitHub ↗
(String language)

Source from the content-addressed store, hash-verified

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;

Callers 1

initMethod · 0.95

Calls 4

trMethod · 0.95
splitMethod · 0.80
getDefaultMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected