From 27b8048fc60e09503825d0fdf77a5ea9ba656d7a Mon Sep 17 00:00:00 2001 From: Shigeru KANEMOTO Date: Sun, 11 Nov 2012 14:57:40 +0900 Subject: [PATCH 1/2] "Boards" must be wrapped in _(...) call. For internationalization, the word "Boards" must be wrapped directly in _(...) call. The call was done in makeOrGetBoardMenu(). However, the second call to makeOrGetBoardMenu() has the argument already wrapped by _(...). --- app/src/processing/app/Base.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 01af9e348..4ff254adc 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -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; From 9e25ad57dba2ba427d4cda23fe8485a170f9e9af Mon Sep 17 00:00:00 2001 From: Shigeru KANEMOTO Date: Sun, 11 Nov 2012 15:12:51 +0900 Subject: [PATCH 2/2] Hack to include a word "Processor" in *.po files. The word "Processor" appears in the "Tools" menu. However, this word is not in the "*.po" files. This is because the word is not in any source code files, and is in "boards.txt". This hack is to include this word in the "*.po" files by extracting _(...) calls automatically by gettext tool. --- app/src/processing/app/debug/TargetPlatform.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/processing/app/debug/TargetPlatform.java b/app/src/processing/app/debug/TargetPlatform.java index 4eabe9a95..542514e39 100644 --- a/app/src/processing/app/debug/TargetPlatform.java +++ b/app/src/processing/app/debug/TargetPlatform.java @@ -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(); 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()) {