Commit b19bcc03 authored by Evan W. Patton's avatar Evan W. Patton

Make extension strings internationalized

Fixes #888

Change-Id: Ib394778a30729c54cfdc787107e542b85cfd3a1a
parent 0909eb27
......@@ -516,6 +516,10 @@ public interface OdeMessages extends Messages {
@Description("Name of Import component menuitem")
String importComponentMenuItem();
@DefaultMessage("Import extension")
@Description("String shown in the palette to import an extension")
String importExtensionMenuItem();
@DefaultMessage("Build component")
@Description("Name of Build component menuitem")
String buildComponentMenuItem();
......@@ -2241,9 +2245,9 @@ public interface OdeMessages extends Messages {
@Description("")
String legoMindstormsComponentPallette();
@DefaultMessage("External")
@DefaultMessage("Extension")
@Description("")
String externalComponentPallette();
String extensionComponentPallette();
@DefaultMessage("External Components")
@Description("")
......
......@@ -32,6 +32,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.google.appinventor.client.Ode.MESSAGES;
/**
* Panel showing Simple components which can be dropped onto the Young Android
* visual designer panel.
......@@ -78,8 +80,13 @@ public class YoungAndroidPalettePanel extends Composite implements SimplePalette
VerticalPanel categoryPanel = new VerticalPanel();
categoryPanel.setWidth("100%");
categoryPanels.put(category, categoryPanel);
stackPalette.add(categoryPanel,
ComponentsTranslation.getCategoryName(category.getName()));
// The production version will not include a mapping for Extension because
// only compile-time categories are included. This allows us to i18n the
// Extension title for the palette.
String title = ComponentCategory.EXTENSION.equals(category) ?
MESSAGES.extensionComponentPallette() :
ComponentsTranslation.getCategoryName(category.getName());
stackPalette.add(categoryPanel, title);
}
}
......@@ -186,7 +193,7 @@ public class YoungAndroidPalettePanel extends Composite implements SimplePalette
}
private void initExtensionPanel() {
Anchor addComponentAnchor = new Anchor("Import extension");
Anchor addComponentAnchor = new Anchor(MESSAGES.importExtensionMenuItem());
addComponentAnchor.setStylePrimaryName("ode-ExtensionAnchor");
addComponentAnchor.addClickHandler(new ClickHandler() {
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment