Skip to content

Commit

Permalink
Fix uppercase region translation keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Oct 30, 2024
1 parent ec51512 commit 76438a7
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions custom_components/nissan_connect/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
# "interval_statistics", default=DEFAULT_INTERVAL_STATISTICS
# ): int,
vol.Required(
"region", default=DEFAULT_REGION): selector.SelectSelector(
"region", default=DEFAULT_REGION.lower()): selector.SelectSelector(
selector.SelectSelectorConfig(
options=REGIONS,
options=[el.lower() for el in REGIONS], # Translation keys must be lowercase
mode=selector.SelectSelectorMode.DROPDOWN,
translation_key="region"
),
Expand All @@ -39,9 +39,9 @@ class NissanConfigFlow(ConfigFlow, domain=DOMAIN):

async def async_step_user(self, info):
errors = {}
if info is not None and info["region"] not in REGIONS:
errors["base"] = "region_error"
elif info is not None:
if info is not None:
info["region"] = info["region"].upper()

await self.async_set_unique_id(info["email"])
self._abort_if_unique_id_configured()

Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/dk.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europe"
"eu": "Europe"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europe"
"eu": "Europe"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Europa"
"eu": "Europa"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/nissan_connect/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"selector": {
"region": {
"options": {
"EU": "Европа"
"eu": "Европа"
}
}
}
Expand Down

0 comments on commit 76438a7

Please sign in to comment.