mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Merge branch 'master' of github.com:arduino/Arduino into LUFA_bootloader
This commit is contained in:
@ -169,6 +169,9 @@ public class Base {
|
||||
// run static initialization that grabs all the prefs
|
||||
Preferences.init(null);
|
||||
|
||||
// load the I18n module for internationalization
|
||||
I18n.init(Preferences.get("editor.languages.current"));
|
||||
|
||||
// setup the theme coloring fun
|
||||
Theme.init();
|
||||
|
||||
|
@ -12,11 +12,25 @@
|
||||
*/
|
||||
|
||||
package processing.app;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Locale.*;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
public class I18n {
|
||||
// start using current locale but still allow using the dropdown list later
|
||||
private static ResourceBundle i18n = ResourceBundle.getBundle("processing.app.Resources");
|
||||
public static Locale locale;
|
||||
|
||||
static protected void init (String language) {
|
||||
// there might be a null pointer exception ... most likely will never happen but the jvm gets mad
|
||||
try {
|
||||
if (language == null || language.trim().length() == 0) locale = Locale.getDefault();
|
||||
else locale = new Locale(language);
|
||||
i18n = ResourceBundle.getBundle("processing.app.Resources", locale);
|
||||
} catch (java.lang.NullPointerException e) {
|
||||
}
|
||||
}
|
||||
|
||||
public static String _(String s) {
|
||||
try {
|
||||
|
@ -79,6 +79,51 @@ public class Preferences {
|
||||
static final String PROMPT_OK = _("OK");
|
||||
static final String PROMPT_BROWSE = _("Browse");
|
||||
|
||||
String[] languages = {
|
||||
_("System Default"),
|
||||
"Català" + " (" + _("Catalan") + ")",
|
||||
"简体中文" + " (" + _("Chinese Simplified") + ")",
|
||||
"繁體中文" + " (" + _("Chinese Traditional") + ")",
|
||||
"Dansk" + " (" + _("Danish") + ")",
|
||||
"Nederlands" + " (" + _("Dutch") + ")",
|
||||
"English" + " (" + _("English") + ")",
|
||||
"Français" + " (" + _("French") + ")",
|
||||
"Pilipino" + " (" + _("Filipino") + ")",
|
||||
"Galego" + " (" + _("Galician") + ")",
|
||||
"Deutsch" + " (" + _("German") + ")",
|
||||
"ελληνικά" + " (" + _("Greek") + ")",
|
||||
"Magyar" + " (" + _("Hungarian") + ")",
|
||||
"Italiano" + " (" + _("Italian") + ")",
|
||||
"日本語" + " (" + _("Japanese") + ")",
|
||||
"Latviešu" + " (" + _("Latvian") + ")",
|
||||
"فارسی" + " (" + _("Persian") + ")",
|
||||
"Português" + " (" + _("Portuguese") + ")",
|
||||
"Română" + " (" + _("Romanian") + ")",
|
||||
"русский" + " (" + _("Russian") + ")",
|
||||
"Español" + " (" + _("Spanish") + ")"};
|
||||
String[] languagesISO = {
|
||||
"",
|
||||
"ca",
|
||||
"zh_cn",
|
||||
"zh_tw",
|
||||
"da",
|
||||
"nl",
|
||||
"en",
|
||||
"fr",
|
||||
"tl",
|
||||
"gl",
|
||||
"de",
|
||||
"el",
|
||||
"hu",
|
||||
"it",
|
||||
"ja",
|
||||
"lv",
|
||||
"fa",
|
||||
"pt_br",
|
||||
"ro",
|
||||
"ru",
|
||||
"es"};
|
||||
|
||||
/**
|
||||
* Standardized width for buttons. Mac OS X 10.3 wants 70 as its default,
|
||||
* Windows XP needs 66, and my Ubuntu machine needs 80+, so 80 seems proper.
|
||||
@ -124,6 +169,7 @@ public class Preferences {
|
||||
JTextField fontSizeField;
|
||||
JCheckBox updateExtensionBox;
|
||||
JCheckBox autoAssociateBox;
|
||||
JComboBox comboLanguage;
|
||||
|
||||
|
||||
// the calling editor, so updates can be applied
|
||||
@ -270,9 +316,25 @@ public class Preferences {
|
||||
top += vmax + GUI_BETWEEN;
|
||||
|
||||
|
||||
// Preferred language: [ ] (requires restart of Arduino)
|
||||
Container box = Box.createHorizontalBox();
|
||||
label = new JLabel(_("Editor language: "));
|
||||
box.add(label);
|
||||
comboLanguage = new JComboBox(languages);
|
||||
comboLanguage.setSelectedIndex((Arrays.asList(languagesISO)).indexOf(Preferences.get("editor.languages.current")));
|
||||
box.add(comboLanguage);
|
||||
label = new JLabel(_(" (requires restart of Arduino)"));
|
||||
box.add(label);
|
||||
pain.add(box);
|
||||
d = box.getPreferredSize();
|
||||
box.setForeground(Color.gray);
|
||||
box.setBounds(left, top, d.width, d.height);
|
||||
right = Math.max(right, left + d.width);
|
||||
top += d.height + GUI_BETWEEN;
|
||||
|
||||
// Editor font size [ ]
|
||||
|
||||
Container box = Box.createHorizontalBox();
|
||||
box = Box.createHorizontalBox();
|
||||
label = new JLabel(_("Editor font size: "));
|
||||
box.add(label);
|
||||
fontSizeField = new JTextField(4);
|
||||
@ -350,7 +412,6 @@ public class Preferences {
|
||||
top += d.height + GUI_BETWEEN;
|
||||
}
|
||||
|
||||
|
||||
// More preferences are in the ...
|
||||
|
||||
label = new JLabel(_("More preferences can be edited directly in the file"));
|
||||
@ -539,6 +600,11 @@ public class Preferences {
|
||||
|
||||
setBoolean("editor.update_extension", updateExtensionBox.isSelected());
|
||||
|
||||
// adds the selected language to the preferences file
|
||||
Object newItem = comboLanguage.getSelectedItem();
|
||||
int pos = (Arrays.asList(languages)).indexOf(newItem.toString()); // position in the languages array
|
||||
set("editor.languages.current",(Arrays.asList(languagesISO)).get(pos));
|
||||
|
||||
editor.applyPreferences();
|
||||
}
|
||||
|
||||
|
1601
app/src/processing/app/Resources_ca.po
Normal file
1601
app/src/processing/app/Resources_ca.po
Normal file
File diff suppressed because it is too large
Load Diff
1011
app/src/processing/app/Resources_ca.properties
Normal file
1011
app/src/processing/app/Resources_ca.properties
Normal file
File diff suppressed because it is too large
Load Diff
1625
app/src/processing/app/Resources_da.po
Normal file
1625
app/src/processing/app/Resources_da.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_da.properties
Normal file
1010
app/src/processing/app/Resources_da.properties
Normal file
File diff suppressed because it is too large
Load Diff
1486
app/src/processing/app/Resources_de.po
Normal file
1486
app/src/processing/app/Resources_de.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_de.properties
Normal file
1010
app/src/processing/app/Resources_de.properties
Normal file
File diff suppressed because it is too large
Load Diff
1487
app/src/processing/app/Resources_el.po
Normal file
1487
app/src/processing/app/Resources_el.po
Normal file
File diff suppressed because it is too large
Load Diff
1011
app/src/processing/app/Resources_el.properties
Normal file
1011
app/src/processing/app/Resources_el.properties
Normal file
File diff suppressed because it is too large
Load Diff
1486
app/src/processing/app/Resources_en.po
Normal file
1486
app/src/processing/app/Resources_en.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_en.properties
Normal file
1010
app/src/processing/app/Resources_en.properties
Normal file
File diff suppressed because it is too large
Load Diff
1642
app/src/processing/app/Resources_es.po
Normal file
1642
app/src/processing/app/Resources_es.po
Normal file
File diff suppressed because it is too large
Load Diff
1015
app/src/processing/app/Resources_es.properties
Normal file
1015
app/src/processing/app/Resources_es.properties
Normal file
File diff suppressed because it is too large
Load Diff
1593
app/src/processing/app/Resources_fa.po
Normal file
1593
app/src/processing/app/Resources_fa.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_fa.properties
Normal file
1010
app/src/processing/app/Resources_fa.properties
Normal file
File diff suppressed because it is too large
Load Diff
1660
app/src/processing/app/Resources_fr.po
Normal file
1660
app/src/processing/app/Resources_fr.po
Normal file
File diff suppressed because it is too large
Load Diff
1022
app/src/processing/app/Resources_fr.properties
Normal file
1022
app/src/processing/app/Resources_fr.properties
Normal file
File diff suppressed because it is too large
Load Diff
1638
app/src/processing/app/Resources_gl.po
Normal file
1638
app/src/processing/app/Resources_gl.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_gl.properties
Normal file
1010
app/src/processing/app/Resources_gl.properties
Normal file
File diff suppressed because it is too large
Load Diff
1507
app/src/processing/app/Resources_hr.po
Normal file
1507
app/src/processing/app/Resources_hr.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_hr.properties
Normal file
1010
app/src/processing/app/Resources_hr.properties
Normal file
File diff suppressed because it is too large
Load Diff
1611
app/src/processing/app/Resources_hu.po
Normal file
1611
app/src/processing/app/Resources_hu.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_hu.properties
Normal file
1010
app/src/processing/app/Resources_hu.properties
Normal file
File diff suppressed because it is too large
Load Diff
1627
app/src/processing/app/Resources_it.po
Normal file
1627
app/src/processing/app/Resources_it.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_it.properties
Normal file
1010
app/src/processing/app/Resources_it.properties
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1637
app/src/processing/app/Resources_lv.po
Normal file
1637
app/src/processing/app/Resources_lv.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_lv.properties
Normal file
1010
app/src/processing/app/Resources_lv.properties
Normal file
File diff suppressed because it is too large
Load Diff
1486
app/src/processing/app/Resources_mr.po
Normal file
1486
app/src/processing/app/Resources_mr.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_mr.properties
Normal file
1010
app/src/processing/app/Resources_mr.properties
Normal file
File diff suppressed because it is too large
Load Diff
1624
app/src/processing/app/Resources_nl.po
Normal file
1624
app/src/processing/app/Resources_nl.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_nl.properties
Normal file
1010
app/src/processing/app/Resources_nl.properties
Normal file
File diff suppressed because it is too large
Load Diff
1486
app/src/processing/app/Resources_pl.po
Normal file
1486
app/src/processing/app/Resources_pl.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_pl.properties
Normal file
1010
app/src/processing/app/Resources_pl.properties
Normal file
File diff suppressed because it is too large
Load Diff
1492
app/src/processing/app/Resources_pt_br.po
Normal file
1492
app/src/processing/app/Resources_pt_br.po
Normal file
File diff suppressed because it is too large
Load Diff
1015
app/src/processing/app/Resources_pt_br.properties
Normal file
1015
app/src/processing/app/Resources_pt_br.properties
Normal file
File diff suppressed because it is too large
Load Diff
1633
app/src/processing/app/Resources_ro.po
Normal file
1633
app/src/processing/app/Resources_ro.po
Normal file
File diff suppressed because it is too large
Load Diff
1012
app/src/processing/app/Resources_ro.properties
Normal file
1012
app/src/processing/app/Resources_ro.properties
Normal file
File diff suppressed because it is too large
Load Diff
1628
app/src/processing/app/Resources_ru.po
Normal file
1628
app/src/processing/app/Resources_ru.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_ru.properties
Normal file
1010
app/src/processing/app/Resources_ru.properties
Normal file
File diff suppressed because it is too large
Load Diff
1625
app/src/processing/app/Resources_tl.po
Normal file
1625
app/src/processing/app/Resources_tl.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_tl.properties
Normal file
1010
app/src/processing/app/Resources_tl.properties
Normal file
File diff suppressed because it is too large
Load Diff
1626
app/src/processing/app/Resources_zh_cn.po
Normal file
1626
app/src/processing/app/Resources_zh_cn.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_zh_cn.properties
Normal file
1010
app/src/processing/app/Resources_zh_cn.properties
Normal file
File diff suppressed because it is too large
Load Diff
1622
app/src/processing/app/Resources_zh_tw.po
Normal file
1622
app/src/processing/app/Resources_zh_tw.po
Normal file
File diff suppressed because it is too large
Load Diff
1010
app/src/processing/app/Resources_zh_tw.properties
Normal file
1010
app/src/processing/app/Resources_zh_tw.properties
Normal file
File diff suppressed because it is too large
Load Diff
@ -573,6 +573,7 @@
|
||||
<tarfileset dir="../"
|
||||
prefix="arduino-${version}"
|
||||
excludes="**/*.tgz,
|
||||
**/*.bz2,
|
||||
**/macosx/,
|
||||
**/windows/,
|
||||
**/work/,
|
||||
|
@ -255,3 +255,8 @@ serial.databits=8
|
||||
serial.stopbits=1
|
||||
serial.parity=N
|
||||
serial.debug_rate=9600
|
||||
|
||||
# I18 Preferences
|
||||
|
||||
# default chosen language (none for none)
|
||||
editor.languages.current =
|
Reference in New Issue
Block a user