Hi,
Is there a way to retrieve the language the user has set in their profile? I need to use this in a Config Flow for an Integration. I retrieve other settings from hass.config
like latitude
and longitude
. But I cannot figure out what module to call to get the language.
Did you find a solution to this Bjarne? I need to retrieve the same info.
Unfortunately I did not. I think you need to ask in Discord to get something like this answered. I never got around to it.
I tried, but no answers.
Will let you know if I find something.
Thanks.
1 Like
In frontend, there is the hass
object available and then you can just call:
hass.selectedLanguage
Thanks. That worked
I would like to get the selectedLanguage in a template sensor, to choose a language-dependent mapper.
hass.selectedLanguage doesn’t work her.
Does anybody know how to solve this?
template:
- select:
- name: "Operation mode (ENG)"
unique_id: operation_mode_translated_to_english
state: >
{% set opt = states('sensor.wolf_cha_0x3_270050_betriebsart_heizgeraet') %}
{% set mapper = {
'ODU Test': 'ODU Test',
'Test': 'Test',
'Frostschutz HK': 'Frost protection heating',
'Frostschutz Warmwasser': 'Frost protection hot water',
'Durchfluss gering': 'Limited flow',
'Vorwärmung': 'Pre-heating',
'Abtaubetrieb': 'Defrosting',
'Antilegionellenfunktion': 'Antilegionalla',
'Warmwasser': 'Hot water',
'WW-Nachlauf': 'Hot water caster',
'Heizbetrieb': 'Heating',
'HZ-Nachlauf': 'Heating caster',
'Aktive Kühlung': 'Active cooling',
'Kaskade': 'Cascade',
'GLT': 'GLT',
'Standby': 'Standby',
'Pump Down': 'Pump down',
'Nachlauf K': 'Nachlauf K',
'Undefiniert': 'Undefined',
'Pool': 'Pool'
}%}
{{ mapper.get(opt) }}