mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 05:46:35 +00:00
Fix backend translations load without selection (#979)
This commit is contained in:
parent
97eec435ab
commit
29f9b2d201
@ -122,10 +122,10 @@ class HomeAssistant extends Polymer.Element {
|
||||
loadBackendTranslations() {
|
||||
if (!this.hass.language) return;
|
||||
|
||||
const language = this.hass.selectedLanguage;
|
||||
const language = this.hass.selectedLanguage || this.hass.language;
|
||||
this.hass.callApi('get', `translations/${language}`).then((result) => {
|
||||
// If we've switched selected languages just ignore this response
|
||||
if (!this.hass.selectedLanguage === language) return;
|
||||
if ((this.hass.selectedLanguage || this.hass.language) !== language) return;
|
||||
|
||||
this._updateResources(language, result.resources);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user