mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-29 10:24:12 +01:00
Allowing boards/libs types and categories to be translated. Fixes #3646
This commit is contained in:
parent
04cfe0c36d
commit
b450a2743e
@ -35,6 +35,8 @@ import cc.arduino.contributions.ui.DropdownItem;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
|
||||
public class DropdownLibraryOfCategoryItem implements DropdownItem<ContributedLibrary> {
|
||||
|
||||
private final String category;
|
||||
@ -44,7 +46,7 @@ public class DropdownLibraryOfCategoryItem implements DropdownItem<ContributedLi
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return category;
|
||||
return tr(category);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,6 +35,8 @@ import cc.arduino.contributions.ui.DropdownItem;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
|
||||
public class DropdownLibraryOfTypeItem implements DropdownItem<ContributedLibrary> {
|
||||
|
||||
private final String type;
|
||||
@ -44,7 +46,7 @@ public class DropdownLibraryOfTypeItem implements DropdownItem<ContributedLibrar
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return type;
|
||||
return tr(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,6 +35,8 @@ import cc.arduino.contributions.ui.DropdownItem;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
|
||||
public class DropdownCoreOfCategoryItem implements DropdownItem<ContributedPlatform> {
|
||||
|
||||
private final String category;
|
||||
@ -44,7 +46,7 @@ public class DropdownCoreOfCategoryItem implements DropdownItem<ContributedPlatf
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return category;
|
||||
return tr(category);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,25 @@ import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class I18n {
|
||||
|
||||
static {
|
||||
tr("Arduino");
|
||||
tr("Partner");
|
||||
tr("Recommended");
|
||||
tr("Contributed");
|
||||
|
||||
tr("Display");
|
||||
tr("Communication");
|
||||
tr("Signal Input/Output");
|
||||
tr("Sensors");
|
||||
tr("Device Control");
|
||||
tr("Timing");
|
||||
tr("Data Storage");
|
||||
tr("Data Processing");
|
||||
tr("Other");
|
||||
tr("Uncategorized");
|
||||
}
|
||||
|
||||
// start using current locale but still allow using the dropdown list later
|
||||
private static ResourceBundle i18n;
|
||||
|
||||
@ -87,7 +106,7 @@ public class I18n {
|
||||
|
||||
/**
|
||||
* Does nothing.
|
||||
* <p/>
|
||||
* <p>
|
||||
* This method is an hack to extract words with gettext tool.
|
||||
*/
|
||||
protected static void unusedStrings() {
|
||||
|
Loading…
Reference in New Issue
Block a user