From befda9a78bbd8f35120549ee632a0e6f84f29fa4 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 12 May 2020 09:08:07 -0700 Subject: [PATCH] Add email as common data string (#35546) --- homeassistant/components/abode/strings.json | 5 ++- .../components/hangouts/strings.json | 2 +- homeassistant/components/icloud/strings.json | 2 +- homeassistant/components/linky/strings.json | 5 ++- .../components/melcloud/strings.json | 2 +- homeassistant/components/sense/strings.json | 5 ++- .../components/simplisafe/strings.json | 2 +- homeassistant/components/tesla/strings.json | 5 ++- homeassistant/components/vesync/strings.json | 5 ++- homeassistant/strings.json | 1 + script/translations/migrate.py | 32 ++++++------------- 11 files changed, 34 insertions(+), 32 deletions(-) diff --git a/homeassistant/components/abode/strings.json b/homeassistant/components/abode/strings.json index f6e7039a908..bf9157abb8a 100644 --- a/homeassistant/components/abode/strings.json +++ b/homeassistant/components/abode/strings.json @@ -3,7 +3,10 @@ "step": { "user": { "title": "Fill in your Abode login information", - "data": { "username": "Email Address", "password": "Password" } + "data": { + "username": "[%key:common::config_flow::data::email%]", + "password": "Password" + } } }, "error": { diff --git a/homeassistant/components/hangouts/strings.json b/homeassistant/components/hangouts/strings.json index 8d5229c9941..cc432be90af 100644 --- a/homeassistant/components/hangouts/strings.json +++ b/homeassistant/components/hangouts/strings.json @@ -12,7 +12,7 @@ "step": { "user": { "data": { - "email": "E-Mail Address", + "email": "[%key:common::config_flow::data::email%]", "password": "Password", "authorization_code": "Authorization Code (required for manual authentication)" }, diff --git a/homeassistant/components/icloud/strings.json b/homeassistant/components/icloud/strings.json index b9e22a7b042..15d5800f838 100644 --- a/homeassistant/components/icloud/strings.json +++ b/homeassistant/components/icloud/strings.json @@ -5,7 +5,7 @@ "title": "iCloud credentials", "description": "Enter your credentials", "data": { - "username": "Email", + "username": "[%key:common::config_flow::data::email%]", "password": "Password", "with_family": "With family" } diff --git a/homeassistant/components/linky/strings.json b/homeassistant/components/linky/strings.json index 7770ce3d0ee..4a595eb6912 100644 --- a/homeassistant/components/linky/strings.json +++ b/homeassistant/components/linky/strings.json @@ -4,7 +4,10 @@ "user": { "title": "Linky", "description": "Enter your credentials", - "data": { "username": "Email", "password": "Password" } + "data": { + "username": "[%key:common::config_flow::data::email%]", + "password": "Password" + } } }, "error": { diff --git a/homeassistant/components/melcloud/strings.json b/homeassistant/components/melcloud/strings.json index f74398e9443..1536cdfefcd 100644 --- a/homeassistant/components/melcloud/strings.json +++ b/homeassistant/components/melcloud/strings.json @@ -5,7 +5,7 @@ "title": "Connect to MELCloud", "description": "Connect using your MELCloud account.", "data": { - "username": "Email used to login to MELCloud.", + "username": "[%key:common::config_flow::data::email%]", "password": "MELCloud password." } } diff --git a/homeassistant/components/sense/strings.json b/homeassistant/components/sense/strings.json index 6c90fdbaab8..4035bb1c6be 100644 --- a/homeassistant/components/sense/strings.json +++ b/homeassistant/components/sense/strings.json @@ -3,7 +3,10 @@ "step": { "user": { "title": "Connect to your Sense Energy Monitor", - "data": { "email": "Email Address", "password": "Password" } + "data": { + "email": "[%key:common::config_flow::data::email%]", + "password": "Password" + } } }, "error": { diff --git a/homeassistant/components/simplisafe/strings.json b/homeassistant/components/simplisafe/strings.json index 7aceed5ce2e..d9593487b6b 100644 --- a/homeassistant/components/simplisafe/strings.json +++ b/homeassistant/components/simplisafe/strings.json @@ -4,7 +4,7 @@ "user": { "title": "Fill in your information.", "data": { - "username": "Email Address", + "username": "[%key:common::config_flow::data::email%]", "password": "Password", "code": "Code (used in Home Assistant UI)" } diff --git a/homeassistant/components/tesla/strings.json b/homeassistant/components/tesla/strings.json index 7a15e5d35d9..dccaa3548db 100644 --- a/homeassistant/components/tesla/strings.json +++ b/homeassistant/components/tesla/strings.json @@ -8,7 +8,10 @@ }, "step": { "user": { - "data": { "username": "Email Address", "password": "Password" }, + "data": { + "username": "[%key:common::config_flow::data::email%]", + "password": "Password" + }, "description": "Please enter your information.", "title": "Tesla - Configuration" } diff --git a/homeassistant/components/vesync/strings.json b/homeassistant/components/vesync/strings.json index 80c934c98db..2fe68b70ff5 100644 --- a/homeassistant/components/vesync/strings.json +++ b/homeassistant/components/vesync/strings.json @@ -3,7 +3,10 @@ "step": { "user": { "title": "Enter Username and Password", - "data": { "username": "Email Address", "password": "Password" } + "data": { + "username": "[%key:common::config_flow::data::email%]", + "password": "Password" + } } }, "error": { "invalid_login": "Invalid username or password" }, diff --git a/homeassistant/strings.json b/homeassistant/strings.json index d43bd749d00..0ac16a6adb1 100644 --- a/homeassistant/strings.json +++ b/homeassistant/strings.json @@ -25,6 +25,7 @@ "confirm_setup": "Do you want to start set up?" }, "data": { + "email": "Email", "username": "Username", "password": "Password", "host": "Host", diff --git a/script/translations/migrate.py b/script/translations/migrate.py index c1b520f606f..8c30f492cb6 100644 --- a/script/translations/migrate.py +++ b/script/translations/migrate.py @@ -392,30 +392,16 @@ def clean_wled(): def run(): """Migrate translations.""" - clean_wled() + # clean_wled() - # Import new common keys - # rename_keys( - # CORE_PROJECT_ID, - # { - # "component::netatmo::config::step::pick_implementation::title": "common::config_flow::title::oauth2_pick_implementation", - # "component::doorbird::config::step::user::data::username": "common::config_flow::data::username", - # "component::doorbird::config::step::user::data::password": "common::config_flow::data::password", - # "component::adguard::config::step::user::data::host": "common::config_flow::data::host", - # "component::adguard::config::step::user::data::port": "common::config_flow::data::port", - # "component::zha::config::step::user::data::usb_path": "common::config_flow::data::usb_path", - # "component::smartthings::config::step::pat::data::access_token": "common::config_flow::data::access_token", - # "component::airvisual::config::step::geography::data::api_key": "common::config_flow::data::api_key", - # "component::doorbird::config::error::invalid_auth": "common::config_flow::error::invalid_auth", - # "component::airvisual::config::error::invalid_api_key": "common::config_flow::error::invalid_api_key", - # "component::tibber::config::error::invalid_access_token": "common::config_flow::error::invalid_access_token", - # "component::doorbird::config::error::unknown": "common::config_flow::error::unknown", - # "component::life360::config::abort::user_already_configured": "common::config_flow::abort::already_configured_account", - # "component::xiaomi_miio::config::abort::already_configured": "common::config_flow::abort::already_configured_device", - # "component::netatmo::config::abort::missing_configuration": "common::config_flow::abort::oauth2_missing_configuration", - # "component::netatmo::config::abort::authorize_url_timeout": "common::config_flow::abort::oauth2_authorize_url_timeout", - # }, - # ) + # Rename existing keys to common keys, + # Old keys have been updated with reference to the common key + rename_keys( + CORE_PROJECT_ID, + { + "component::icloud::config::step::user::data::username": "common::config_flow::data::email", + }, + ) # find_frontend_states()