Skip to content

Commit

Permalink
Added internationalisation of new strings
Browse files Browse the repository at this point in the history
  • Loading branch information
philipabbey committed Jul 26, 2024
1 parent 8b22d25 commit e892d53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions resources/strings/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<string id="Cached">Cached</string>
<string id="Menu">Menu</string>
<string id="Memory">Memory</string>
<string id="Empty">Empty</string>
<string id="TemplateError">Template Error</string>
<string id="PotentialError">Potential Error</string>

<!-- For the settings GUI -->
<string id="SettingsSelect">Select...</string>
Expand Down
6 changes: 3 additions & 3 deletions source/HomeAssistantTemplateMenuItem.mc
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ class HomeAssistantTemplateMenuItem extends WatchUi.IconMenuItem {
status = WatchUi.loadResource($.Rez.Strings.Available) as Lang.String;
var label = data.get("request");
if (label == null) {
setSubLabel("Empty");
setSubLabel($.Rez.Strings.Empty);
} else if(label instanceof Lang.String) {
setSubLabel(label);
} else if(label instanceof Lang.Dictionary) {
System.println("HomeAssistantTemplateMenuItem onReturnGetState() label = " + label);
if (label.get("error") != null) {
setSubLabel("Template Error");
setSubLabel($.Rez.Strings.TemplateError);
} else {
setSubLabel("Potential Error");
setSubLabel($.Rez.Strings.PotentialError);
}
}
requestUpdate();
Expand Down

0 comments on commit e892d53

Please sign in to comment.