Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated sensor and translations to conform with new translation metod… #20

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions custom_components/swemail/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self, hass, worker, config, provider):
self._attr_unique_id = f"{DOMAIN}_{self._postalcode}_{self._provider}"
self._attr_name = f"{self._provider.capitalize()} {SENSOR_NAME} {self._postalcode}"
self._attr_icon = "mdi:email-fast-outline"
self._attr_translation_key = "maildaysleft"
self._attr_device_info = {
ATTR_IDENTIFIERS: {(DOMAIN, DEVICE_NAME)},
ATTR_NAME: DEVICE_NAME,
Expand Down Expand Up @@ -130,6 +131,7 @@ def __init__(self, hass, worker, config):
self._attr_unique_id = f"{DOMAIN}_{self._postalcode}"
self._attr_name = f"Mail {SENSOR_NAME} {self._postalcode}"
self._attr_icon = "mdi:email-fast-outline"
self._attr_translation_key = "maildaysleft"
self._attr_device_info = {
ATTR_IDENTIFIERS: {(DOMAIN, DEVICE_NAME)},
ATTR_NAME: DEVICE_NAME,
Expand Down
23 changes: 23 additions & 0 deletions custom_components/swemail/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,28 @@
"title": "Swedish Mail Delivery"
}
}
},
"entity": {
"sensor": {
"maildaysleft": {
"state": {
"0": "Today",
"1": "Tomorrow",
"2": "In two days",
"3": "In three days",
"4": "In four days",
"5": "In five days",
"6": "In six days",
"7": "In a week",
"8": "In eight days",
"9": "In nine days",
"10": "In ten days",
"11": "In eleven days",
"12": "In twelve days",
"13": "In thirteen days",
"14": "In two weeks"
}
}
}
}
}
23 changes: 23 additions & 0 deletions custom_components/swemail/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,28 @@
"title": "Livraison de la poste suédoise"
}
}
},
"entity": {
"sensor": {
"maildaysleft": {
"state": {
"0": "Aujourd'hui",
"1": "Demain",
"2": "Dans 2 jours",
"3": "Dans 3 jours",
"4": "Dans 4 jours",
"5": "Dans 5 jours",
"6": "Dans 6 jours",
"7": "Dans 1 semaine",
"8": "Dans 8 jours",
"9": "Dans 9 jours",
"10": "Dans 10 jours",
"11": "Dans 11 jours",
"12": "Dans 12 jours",
"13": "Dans 13 jours",
"14": "Dans 2 semaines"
}
}
}
}
}
38 changes: 0 additions & 38 deletions custom_components/swemail/translations/sensor.en.json

This file was deleted.

38 changes: 0 additions & 38 deletions custom_components/swemail/translations/sensor.fr.json

This file was deleted.

38 changes: 0 additions & 38 deletions custom_components/swemail/translations/sensor.sv.json

This file was deleted.

23 changes: 23 additions & 0 deletions custom_components/swemail/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,28 @@
"title": "Svensk Postutdelning"
}
}
},
"entity": {
"sensor": {
"maildaysleft": {
"state": {
"0": "Idag",
"1": "I morgon",
"2": "I övermorgon",
"3": "Om tre dagar",
"4": "Om fyra dagar",
"5": "Om fem dagar",
"6": "Om sex dagar",
"7": "Om en vecka",
"8": "Om 8 dagar",
"9": "Om 9 dagar",
"10": "Om 10 dagar",
"11": "Om 11 dagar",
"12": "Om 12 dagar",
"13": "Om 13 dagar",
"14": "Om två veckor"
}
}
}
}
}