diff --git a/widget/manifest.xml b/widget/manifest.xml index 87307af..c8568b9 100644 --- a/widget/manifest.xml +++ b/widget/manifest.xml @@ -85,6 +85,7 @@ eng + fre diff --git a/widget/resources-fre/layouts/layout.xml b/widget/resources-fre/layouts/layout.xml new file mode 100644 index 0000000..a3985de --- /dev/null +++ b/widget/resources-fre/layouts/layout.xml @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/widget/resources-fre/properties.xml b/widget/resources-fre/properties.xml new file mode 100644 index 0000000..7bc7370 --- /dev/null +++ b/widget/resources-fre/properties.xml @@ -0,0 +1,40 @@ + + + https://hassio.url + + + + Garmin + + + + + Hôte: (exemple: https://hassio.url) + + Token d'accès longue durée (Optionnel) + Scènes: (scene1,scene2,scene3) + Groupe: (Groupe utilisé pour importer des entités) + Rafraichir dés l'affichage (Utilise plus de batterie et de ressource réseau) + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/widget/resources-fre/strings/strings.xml b/widget/resources-fre/strings/strings.xml new file mode 100644 index 0000000..0406456 --- /dev/null +++ b/widget/resources-fre/strings/strings.xml @@ -0,0 +1,46 @@ + + HassControl + + + + Aucune entité configurée + + + Se connecter + Se déconnecter + Paramètres + Scènes + Entités + Retour + Rafraîchissement en cours + + + En cours d'éxécution + Verouillage + Déverouillage + Fermeture + Ouverture + Pression + Extinction + Allumage + + + Vue de départ + Rafraîchir les entités + + + Échec + Erreur inconnue + Téléphone non connecté + + Vérifier les paramètres du widget, URL invalide + Ressource non trouvée + Authentification échouée + + Serveur non joignable + Identifiant révoqué + + Aucune entité à basculer,\nactualisez le groupe depuis\nles paramètres du widget + + Groupe\nnon\nconfiguré + \ No newline at end of file diff --git a/widget/resources/strings/strings.xml b/widget/resources/strings/strings.xml index ed14acb..8d0c23c 100644 --- a/widget/resources/strings/strings.xml +++ b/widget/resources/strings/strings.xml @@ -5,9 +5,31 @@ No entities configured + + Login + Logout + Settings + Scenes + Entities + Back + Refreshing + + Running + Locking + Unlocking + Closing + Opening + Pressing + Turning off + Turning on + + + Start View + Refresh entities + Failed Unknown error Phone not connected @@ -17,4 +39,8 @@ Server not reachable Login Revoked + + No entity to toggle,\nplease refresh group\nfrom settings + + Group\nnot\nconfigured \ No newline at end of file diff --git a/widget/source/Entities/EntityListView.mc b/widget/source/Entities/EntityListView.mc index 80755bd..ec84e85 100644 --- a/widget/source/Entities/EntityListView.mc +++ b/widget/source/Entities/EntityListView.mc @@ -79,7 +79,7 @@ class EntityListDelegate extends Ui.BehaviorDelegate { _mController.toggleEntity(entity); } else { App.getApp().menu.showRootMenu(); - App.getApp().viewController.showError("No entity to toggle,\nplease refresh group\nfrom settings"); + App.getApp().viewController.showError(Ui.loadResource(Rez.Strings.Error_No_Entity_Toggle)); } return true; diff --git a/widget/source/ErrorView.mc b/widget/source/ErrorView.mc index 1a23c75..635adcb 100644 --- a/widget/source/ErrorView.mc +++ b/widget/source/ErrorView.mc @@ -50,7 +50,7 @@ class ErrorView extends Ui.View { var titleEl = View.findDrawableById("Title"); var messageEl = View.findDrawableById("Message"); - titleEl.setText("Failed"); + titleEl.setText(Rez.Strings.Error_Failed); messageEl.setText(_message.toString()); View.onUpdate(dc); diff --git a/widget/source/Menu/MenuController.mc b/widget/source/Menu/MenuController.mc index a1cfebb..0d93c5d 100644 --- a/widget/source/Menu/MenuController.mc +++ b/widget/source/Menu/MenuController.mc @@ -32,26 +32,26 @@ class MenuController { if (App.getApp().isLoggedIn()) { menu.addItem(new Ui.MenuItem( - "Scenes", + Rez.Strings.Generic_Scenes, "", MenuController.MENU_SWITCH_TO_SCENES, {} )); menu.addItem(new Ui.MenuItem( - "Entities", + Rez.Strings.Generic_Entities, "", MenuController.MENU_SWITCH_TO_ENTITIES, {} )); menu.addItem(new Ui.MenuItem( - "Settings", + Rez.Strings.Generic_Settings, "", MenuController.MENU_ENTER_SETTINGS, {} )); } else { menu.addItem(new Ui.MenuItem( - "Login", + Rez.Strings.Generic_Login, "", MenuController.MENU_LOGIN, {} @@ -63,23 +63,23 @@ class MenuController { function showSettingsMenu() { var menu = new Ui.Menu2({ - :title => "Settings" + :title => Rez.Strings.Generic_Settings }); menu.addItem(new Ui.MenuItem( - "Start View", + Rez.Strings.SettingsMenu_Start_View, App.getApp().getStartView(), MenuController.MENU_SELECT_START_VIEW, {} )); menu.addItem(new Ui.MenuItem( - "Refresh entities", + Rez.Strings.SettingsMenu_Refresh_Entities, Hass.getGroup(), MenuController.MENU_REFRESH_ENTITIES, {} )); menu.addItem(new Ui.MenuItem( - "Logout", + Rez.Strings.Generic_Logout, "", MenuController.MENU_LOGOUT, {} @@ -90,7 +90,7 @@ class MenuController { function showSelectStartViewMenu() { var menu = new Ui.Menu2({ - :title => "Start view" + :title => Rez.Strings.SettingsMenu_Start_View }); var currentStartView = App.getApp().getStartView(); @@ -106,21 +106,21 @@ class MenuController { } menu.addItem(new Ui.MenuItem( - "Entities", + Rez.Strings.Generic_Entities, entitiesSubtitle, MenuController.MENU_SELECT_START_VIEW_ENTITIES, {} )); menu.addItem(new Ui.MenuItem( - "Scenes", + Rez.Strings.Generic_Scenes, scenesSubtitle, MenuController.MENU_SELECT_START_VIEW_SCENES, {} )); menu.addItem(new Ui.MenuItem( - "Back", + Rez.Strings.Generic_Back, "", MenuController.MENU_BACK, {} diff --git a/widget/source/ViewController.mc b/widget/source/ViewController.mc index 643e4da..bc3f9a9 100644 --- a/widget/source/ViewController.mc +++ b/widget/source/ViewController.mc @@ -168,7 +168,7 @@ class ViewController { function showError(error) { removeLoaderImmediate(); - var message = "Unknown Error"; + var message = Rez.Strings.Error_Unknown; if (error instanceof Error) { message = error.toShortString(); diff --git a/widget/source/hass/Hass.mc b/widget/source/hass/Hass.mc index e83003a..d80f05d 100644 --- a/widget/source/hass/Hass.mc +++ b/widget/source/hass/Hass.mc @@ -282,11 +282,11 @@ module Hass { var group = getGroup(); if (group == null) { - App.getApp().viewController.showError("Group\nnot\nconfigured"); + App.getApp().viewController.showError(Ui.loadResource(Rez.Strings.Error_Group_Not_Configured)); return; } - App.getApp().viewController.showLoader("Refreshing"); + App.getApp().viewController.showLoader(Rez.Strings.Generic_Refreshing); client.getEntity(group, null, Utils.method(Hass, :_onReceiveEntities)); } @@ -336,33 +336,33 @@ module Hass { if (entity.getType() == Entity.TYPE_SCRIPT) { action = Client.ENTITY_ACTION_TURN_ON; - loadingText = "Running"; + loadingText = Rez.Strings.LoadingText_Running; } else if (entity.getType() == Entity.TYPE_LOCK) { if (currentState == Entity.STATE_UNLOCKED) { action = Client.ENTITY_ACTION_LOCK; - loadingText = "Locking"; + loadingText = Rez.Strings.LoadingText_Locking; } else if (currentState == Entity.STATE_LOCKED) { action = Client.ENTITY_ACTION_UNLOCK; - loadingText = "Unlocking"; + loadingText = Rez.Strings.LoadingText_Unlocking; } } else if (entity.getType() == Entity.TYPE_COVER) { if (currentState == Entity.STATE_OPEN) { action = Client.ENTITY_ACTION_CLOSE_COVER; - loadingText = "Closing"; + loadingText = Rez.Strings.LoadingText_Closing; } else if (currentState == Entity.STATE_CLOSED) { action = Client.ENTITY_ACTION_OPEN_COVER; - loadingText = "Opening"; + loadingText = Rez.Strings.LoadingText_Opening; } } else if (entity.getType() == Entity.TYPE_BUTTON || entity.getType() == Entity.TYPE_INPUT_BUTTON) { action = Client.ENTITY_ACTION_PRESS; - loadingText = "Pressing"; + loadingText = Rez.Strings.LoadingText_Pressing; } else { if (currentState == Entity.STATE_ON) { action = Client.ENTITY_ACTION_TURN_OFF; - loadingText = "Turning off"; + loadingText = Rez.Strings.LoadingText_Turning_Off; } else if (currentState == Entity.STATE_OFF) { action = Client.ENTITY_ACTION_TURN_ON; - loadingText = "Turning on"; + loadingText = Rez.Strings.LoadingText_Turning_On; } }