From d4b257854da24716fa0ddb4834594b6e4c48167d Mon Sep 17 00:00:00 2001 From: Adam Mills Date: Mon, 26 Feb 2018 19:15:51 -0500 Subject: [PATCH] Add localization to the automation editor (#923) * Add localization to the automation editor * Unnest automation strings from `section` --- js/panel-config/automation.js | 38 ++-- js/panel-config/condition/condition_edit.js | 11 +- js/panel-config/condition/condition_row.js | 6 +- js/panel-config/condition/index.js | 5 +- js/panel-config/condition/numeric_state.js | 8 +- js/panel-config/condition/state.js | 4 +- js/panel-config/condition/sun.js | 18 +- js/panel-config/condition/template.js | 4 +- js/panel-config/condition/time.js | 6 +- js/panel-config/condition/zone.js | 6 +- js/panel-config/script.js | 3 +- js/panel-config/script/action_edit.js | 23 +-- js/panel-config/script/action_row.js | 6 +- js/panel-config/script/call_service.js | 5 +- js/panel-config/script/condition.js | 4 +- js/panel-config/script/delay.js | 5 +- js/panel-config/script/event.js | 7 +- js/panel-config/script/index.js | 5 +- js/panel-config/script/wait.js | 7 +- js/panel-config/trigger/event.js | 6 +- js/panel-config/trigger/homeassistant.js | 8 +- js/panel-config/trigger/index.js | 5 +- js/panel-config/trigger/mqtt.js | 6 +- js/panel-config/trigger/numeric_state.js | 8 +- js/panel-config/trigger/state.js | 6 +- js/panel-config/trigger/sun.js | 10 +- js/panel-config/trigger/template.js | 4 +- js/panel-config/trigger/time.js | 4 +- js/panel-config/trigger/trigger_edit.js | 11 +- js/panel-config/trigger/trigger_row.js | 6 +- js/panel-config/trigger/zone.js | 12 +- .../automation/ha-automation-editor.html | 25 ++- .../automation/ha-automation-picker.html | 19 +- panels/config/script/ha-script-editor.html | 6 +- src/components/entity/ha-entity-picker.html | 16 +- src/components/ha-service-picker.html | 7 +- src/translations/en.json | 166 +++++++++++++++++- 37 files changed, 337 insertions(+), 159 deletions(-) diff --git a/js/panel-config/automation.js b/js/panel-config/automation.js index 0b9f9197f2..3793fd7830 100644 --- a/js/panel-config/automation.js +++ b/js/panel-config/automation.js @@ -42,7 +42,7 @@ export default class Automation extends Component { }); } - render({ automation, isWide, hass }) { + render({ automation, isWide, hass, localize }) { const { alias, trigger, condition, action } = automation; @@ -52,12 +52,12 @@ export default class Automation extends Component { {alias} - Use automations to bring your home alive. + {localize('ui.panel.config.automation.editor.introduction')}
- Triggers + {localize('ui.panel.config.automation.editor.triggers.header')} - Triggers are what starts the processing of an automation rule. - It is possible to specify multiple triggers for the same rule. - Once a trigger starts, Home Assistant will validate the conditions, - if any, and call the action. -

- Learn more about triggers. -

+
- Conditions + {localize('ui.panel.config.automation.editor.conditions.header')} - Conditions are an optional part of an automation rule and can be used to prevent - an action from happening when triggered. Conditions look very similar to triggers - but are very different. A trigger will look at events happening in the system - while a condition only looks at how the system looks right now. A trigger can - observe that a switch is being turned on. A condition can only see if a switch - is currently on or off. -

- Learn more about conditions. -

+
- Action + {localize('ui.panel.config.automation.editor.actions.header')} - The actions are what Home Assistant will do when the automation is triggered. -

- Learn more about actions. -

+