Added internationalisation of new strings

This commit is contained in:
Philip Abbey
2024-07-26 08:50:10 +01:00
parent a86133fd87
commit 1eb2fbed0e
2 changed files with 6 additions and 3 deletions

View File

@ -37,6 +37,9 @@
<string id="Cached" scope="glance">Cached</string>
<string id="GlanceMenu" scope="glance">Menu</string>
<string id="Memory" scope="glance">Memory</string>
<string id="Empty" scope="glance">Empty</string>
<string id="TemplateError" scope="glance">Template Error</string>
<string id="PotentialError" scope="glance">Potential Error</string>
<!-- For the settings GUI -->
<string id="SettingsSelect">Select...</string>

View File

@ -133,15 +133,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();