mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Ensure push notification description reacts to language change (#7856)
This commit is contained in:
parent
25f7cbea5a
commit
daaf2b1796
@ -25,7 +25,7 @@ class HaPushNotificationsRow extends LocalizeMixin(PolymerElement) {
|
|||||||
>[[localize('ui.panel.profile.push_notifications.header')]]</span
|
>[[localize('ui.panel.profile.push_notifications.header')]]</span
|
||||||
>
|
>
|
||||||
<span slot="description">
|
<span slot="description">
|
||||||
[[_description(_platformLoaded, _pushSupported)]]
|
[[localize(_descrLocalizeKey)]]
|
||||||
<a
|
<a
|
||||||
href="[[_computeDocumentationUrl(hass)]]"
|
href="[[_computeDocumentationUrl(hass)]]"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -45,6 +45,10 @@ class HaPushNotificationsRow extends LocalizeMixin(PolymerElement) {
|
|||||||
return {
|
return {
|
||||||
hass: Object,
|
hass: Object,
|
||||||
narrow: Boolean,
|
narrow: Boolean,
|
||||||
|
_descrLocalizeKey: {
|
||||||
|
type: String,
|
||||||
|
computed: "_descriptionKey(_platformLoaded, _pushSupported)",
|
||||||
|
},
|
||||||
_platformLoaded: {
|
_platformLoaded: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
computed: "_compPlatformLoaded(hass)",
|
computed: "_compPlatformLoaded(hass)",
|
||||||
@ -72,7 +76,7 @@ class HaPushNotificationsRow extends LocalizeMixin(PolymerElement) {
|
|||||||
return !platformLoaded || !pushSupported_;
|
return !platformLoaded || !pushSupported_;
|
||||||
}
|
}
|
||||||
|
|
||||||
_description(platformLoaded, pushSupported_) {
|
_descriptionKey(platformLoaded, pushSupported_) {
|
||||||
let key;
|
let key;
|
||||||
if (!pushSupported_) {
|
if (!pushSupported_) {
|
||||||
key = "error_use_https";
|
key = "error_use_https";
|
||||||
@ -81,7 +85,7 @@ class HaPushNotificationsRow extends LocalizeMixin(PolymerElement) {
|
|||||||
} else {
|
} else {
|
||||||
key = "description";
|
key = "description";
|
||||||
}
|
}
|
||||||
return this.localize(`ui.panel.profile.push_notifications.${key}`);
|
return `ui.panel.profile.push_notifications.${key}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user