Skip to content

Commit 9ffe1e2

Browse files
committed
Do not translate labels of boards submenus
Otherwise it may happen some weird sorting when untraslated and translated labels are sorted together: Arduino megaAVR Boards Arduino nRF52 Board ESP32 Arduino ESP8266 Modules Schede Arduino AVR <-- the localized string falls to the bottom Also there is no way for 3rd party boards developers to actually provide a translation, so let's just remove them.
1 parent 55fa3f5 commit 9ffe1e2

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

Diff for: app/src/processing/app/Base.java

+11-8
Original file line numberDiff line numberDiff line change
@@ -1481,19 +1481,22 @@ public void actionPerformed(ActionEvent actionevent) {
14811481
ButtonGroup boardsButtonGroup = new ButtonGroup();
14821482
Map<String, ButtonGroup> buttonGroupsMap = new HashMap<>();
14831483

1484-
List<JMenu> platformMenus = new ArrayList<JMenu>();
1484+
class PlatformJMenu extends JMenu {
1485+
public PlatformJMenu(TargetPlatform pl) {
1486+
String text = pl.getPreferences().get("name");
1487+
if (text == null) {
1488+
text = pl.getContainerPackage().getId() + "-" + pl.getId();
1489+
}
1490+
setText(text);
1491+
}
1492+
}
1493+
List<PlatformJMenu> platformMenus = new ArrayList<>();
14851494

14861495
// Cycle through all packages
14871496
for (TargetPackage targetPackage : BaseNoGui.packages.values()) {
14881497
// For every package cycle through all platform
14891498
for (TargetPlatform targetPlatform : targetPackage.platforms()) {
1490-
1491-
// Add a title for each platform
1492-
String platformLabel = targetPlatform.getPreferences().get("name");
1493-
if (platformLabel == null)
1494-
platformLabel = targetPackage.getId() + "-" + targetPlatform.getId();
1495-
1496-
JMenu platformBoardsMenu = new JMenu(tr(platformLabel));
1499+
PlatformJMenu platformBoardsMenu = new PlatformJMenu(targetPlatform);
14971500
MenuScroller.setScrollerFor(platformBoardsMenu);
14981501
platformMenus.add(platformBoardsMenu);
14991502

Diff for: arduino-core/src/processing/app/I18n.java

-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ public static String format(String fmt, Object... args) {
106106
* This method is an hack to extract words with gettext tool.
107107
*/
108108
protected static void unusedStrings() {
109-
// These phrases are defined in the "platform.txt".
110-
tr("Arduino AVR Boards");
111-
tr("Arduino ARM (32-bits) Boards");
112-
113109
// This word is defined in the "boards.txt".
114110
tr("Processor");
115111
}

0 commit comments

Comments
 (0)