Skip to content

Commit

Permalink
Added localization for mode selector
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknn committed Oct 4, 2024
1 parent c74fd05 commit 9ae8fbf
Show file tree
Hide file tree
Showing 34 changed files with 41 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion custom_components/swegon/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Creating nested dictionary of key/pairs
OPTIONS = {
"Op_Mode": {0: "Stoppet", 1: "Borte", 2: "Hjemme", 3: "Boost", 4: "Reise"},
"Op_Mode": {0: "stopped", 1: "away", 2: "home", 3: "boost", 4: "travel"},
}

DATA_TYPE = namedtuple('DataType', ['category', 'icon'])
Expand Down Expand Up @@ -50,6 +50,7 @@ def __init__(self, coordinator, swegonentity):
self._options = self.coordinator.get_config_options()
else:
self._options = swegonentity.options
self._attr_translation_key = "op_mode"

@property
def current_option(self):
Expand Down
13 changes: 13 additions & 0 deletions custom_components/swegon/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,18 @@
"add_success": "Device {dev_name} successfully added",
"already_configured": "Device {dev_name} is already configured"
}
},
"entity": {
"select": {
"op_mode": {
"state": {
"stopped": "Stopped",
"away": "Away",
"home": "Home",
"boost": "Boost",
"travel": "Travel"
}
}
}
}
}
13 changes: 13 additions & 0 deletions custom_components/swegon/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,18 @@
"add_success": "Device {dev_name} successfully added",
"already_configured": "Device {dev_name} is already configured"
}
},
"entity": {
"select": {
"op_mode": {
"state": {
"stopped": "Stopped",
"away": "Away",
"home": "Home",
"boost": "Boost",
"travel": "Travel"
}
}
}
}
}
13 changes: 13 additions & 0 deletions custom_components/swegon/translations/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,18 @@
"add_success": "Enhet {dev_name} ble lagt til",
"already_configured": "Enhet {dev_name} er allerede konfigurert"
}
},
"entity": {
"select": {
"op_mode": {
"state": {
"stopped": "Stoppet",
"away": "Borte",
"home": "Hjemme",
"boost": "Boost",
"travel": "Reise"
}
}
}
}
}

0 comments on commit 9ae8fbf

Please sign in to comment.