Skip to content

Commit c33b436

Browse files
committed
Fix links in translations for hassfest
1 parent 29919a3 commit c33b436

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

custom_components/yandex_station/config_flow.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ async def async_step_user(self, user_input=None):
7070
if method == "qr":
7171
return self.async_show_form(
7272
step_id="qr",
73-
description_placeholders={"qr_url": await self.yandex.get_qr()},
73+
description_placeholders={
74+
"qr_url": await self.yandex.get_qr(),
75+
"ya_url": "https://passport.yandex.ru/profile",
76+
},
7477
)
7578

7679
if method == "auth":
@@ -87,21 +90,24 @@ async def async_step_user(self, user_input=None):
8790
if method == "email":
8891
return self.async_show_form(
8992
step_id=method,
90-
data_schema=vol.Schema(
91-
{
92-
vol.Required("username"): str,
93-
}
94-
),
93+
data_schema=vol.Schema({vol.Required("username"): str}),
94+
)
95+
96+
if method == "cookies":
97+
return self.async_show_form(
98+
step_id=method,
99+
data_schema=vol.Schema({vol.Required(method): str}),
100+
description_placeholders={
101+
# hassfest prohibits the use of links in translation files
102+
"ex_url": "https://chrome.google.com/webstore/detail/copy-cookies/jcbpglbplpblnagieibnemmkiamekcdg",
103+
"ya_url": "https://passport.yandex.ru/profile",
104+
},
95105
)
96106

97107
# cookies, token
98108
return self.async_show_form(
99109
step_id=method,
100-
data_schema=vol.Schema(
101-
{
102-
vol.Required(method): str,
103-
}
104-
),
110+
data_schema=vol.Schema({vol.Required(method): str}),
105111
)
106112

107113
async def async_step_qr(self, user_input):

custom_components/yandex_station/translations/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
},
1919
"qr": {
20-
"description": "У вас должен быть включен **Вход без пароля** в [профиле Яндекса](https://passport.yandex.ru/profile).\n\nОтсканируйте код в мобильном приложении **Яндекс**. Если включена двухфакторная авторизация - отсканируйте код в мобильном приложении **Яндекс.Ключ**. И затем нажмите **Подтвердить**.\n\nВ тёмной теме код читается плохо!\n![]({qr_url})"
20+
"description": "У вас должен быть включен **Вход без пароля** в [профиле Яндекса]({ya_url}).\n\nОтсканируйте код в мобильном приложении **Яндекс**. Если включена двухфакторная авторизация - отсканируйте код в мобильном приложении **Яндекс.Ключ**. И затем нажмите **Подтвердить**.\n\nВ тёмной теме код читается плохо!\n![]({qr_url})"
2121
},
2222
"auth": {
2323
"description": "Введите логин и пароль аккаунта на Яндексе. Если включена двухфакторная аутентификация - введите одноразовый пароль из приложения Яндекс.Ключ",
@@ -35,7 +35,7 @@
3535
"description": "Ссылка отправлена на ящик `{email}`. Подтвердите её там, и затем нажмите **Подтвердить** здесь."
3636
},
3737
"cookies": {
38-
"description": "1. Установите расширение [Copy Cookies](https://chrome.google.com/webstore/detail/copy-cookies/jcbpglbplpblnagieibnemmkiamekcdg) в Google Chrome, Yandex Browser или Opera\n2. Авторизуйтесь в [Yandex ID](https://passport.yandex.ru/profile) (не используйте режим инкогнито)\n3. Скопируйте сюда Cookies с помощью расширения",
38+
"description": "1. Установите расширение [Copy Cookies]({ex_url}) в Google Chrome, Yandex Browser или Opera\n2. Авторизуйтесь в [Yandex ID]({ya_url}) (не используйте режим инкогнито)\n3. Скопируйте сюда Cookies с помощью расширения",
3939
"data": {
4040
"cookies": "Cookies JSON"
4141
}

0 commit comments

Comments
 (0)