1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Merge pull request #128 from sgk/ide15i18n

Fixes to include "Boards" and "Processor" entries in the "*.po" files.
This commit is contained in:
Cristian Maglie 2012-11-11 01:47:13 -08:00
commit 16b28ed74c
2 changed files with 11 additions and 4 deletions

View File

@ -1124,7 +1124,7 @@ public class Base {
}
public void rebuildBoardsMenu(JMenu toolsMenu, final Editor editor) {
JMenu boardsMenu = makeOrGetBoardMenu(toolsMenu, "Board");
JMenu boardsMenu = makeOrGetBoardMenu(toolsMenu, _("Board"));
String selPackage = Preferences.get("target_package");
String selPlatform = Preferences.get("target_platform");
@ -1287,13 +1287,12 @@ public class Base {
}
private JMenu makeOrGetBoardMenu(JMenu toolsMenu, String label) {
String i18nLabel = _(label);
for (JMenu menu : Editor.boardsMenus) {
if (i18nLabel.equals(menu.getText())) {
if (label.equals(menu.getText())) {
return menu;
}
}
JMenu menu = new JMenu(i18nLabel);
JMenu menu = new JMenu(label);
Editor.boardsMenus.add(menu);
toolsMenu.add(menu);
return menu;

View File

@ -23,6 +23,8 @@
*/
package processing.app.debug;
import static processing.app.I18n._;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
@ -46,6 +48,12 @@ public class TargetPlatform {
programmers = new HashMap<String, PreferencesMap>();
preferences = new PreferencesMap();
if (false) {
// Hack to extract this word by gettext tool.
// This word is actually defined in the "boards.txt".
String notused = _("Processor");
}
try {
File boardsFile = new File(_folder, "boards.txt");
if (boardsFile.exists()) {