Skip to content

Commit

Permalink
[FR] Error message improvements (#1895)
Browse files Browse the repository at this point in the history
* Error message improvments

* Simplify our mapping of the cover device classes

* Update sentences/fr/_common.yaml

Co-authored-by: Paul Bottein <[email protected]>

---------

Co-authored-by: Paul Bottein <[email protected]>
  • Loading branch information
jlpouffier and piitaya authored Jan 25, 2024
1 parent dec1762 commit 5c0e124
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 9 deletions.
57 changes: 49 additions & 8 deletions sentences/fr/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,54 @@ language: fr
responses:
errors:
no_intent: "Désolé, je n'ai pas compris"
no_area: "Aucune zone appelée {{ area }}"
no_domain: "{{ area }} ne contient pas de {{ domain }}"
no_device_class: "{{ area }} ne contient pas de {{ device_class }}"
no_entity: "Aucun appareil ou entité appelé {{ entity }}"
no_area: "Désolé, je ne connais pas la pièce {{ area }}"
no_domain: |
{% set translations_domains_with_article = {
"button": "de boutons",
"camera": "de caméras",
"input_button": "de boutons",
"alarm_control_panel": "d'alarmes",
"automation": "d'automatisations",
"fan": "de ventilateurs",
"climate": "de thermostats",
"humidifier": "d'humidificateurs",
"input_boolean": "de commutateurs",
"siren": "de sirènes",
"water_heater": "de ballon d'eau chaude",
"light": "de lumières",
"switch": "de commutateurs",
"script": "de scripts",
"remote": "de télécommandes",
"lock": "de verrous",
"vacuum": "d'aspirateurs",
"scene": "de scènes",
"media_player": "de lecteurs multimédia",
"lawn_mower": "de tondeuses à gazon",
"valve": "de vannes"
} %}
{% if domain in translations_domains_with_article %}
Désolé, je n'ai pas trouvé {{ translations_domains_with_article[domain] }} dans {{ area }}
{% else %}
Désolé, je n'ai rien trouvé de correspondant dans {{ area }}
{% endif %}
no_device_class: |
{% set translations_cover_device_classes_with_article = {
"awning": "d'auvents",
"blind": "de stores",
"curtain": "de rideaux",
"door": "de portes",
"garage": "de portes de garage",
"gate": "de portes",
"shade": "de stores",
"shutter": "de volets",
"window": "de fenêtres"
} %}
{% if device_class in translations_cover_device_classes_with_article %}
Désolé, je n'ai pas trouvé {{ translations_cover_device_classes_with_article[device_class] }} dans {{ area }}
{% else %}
Désolé, je n'ai rien trouvé de correspondant dans {{ area }}
{% endif %}
no_entity: "Désolé, je ne connais pas l'appareil {{ entity }}"
handle_error: "Une erreur est intervenue pendant le traitement"
lists:
color:
Expand Down Expand Up @@ -74,13 +118,10 @@ lists:
out: "closing"
cover_classes:
values:
- in: "store[s]"
- in: "store[s] [vénitien[s]]"
out:
- "awning"
- "blind"
- "shade"
- in: "store[s] vénitien[s]"
out: "blind"
- in: "(banne[s])|(auvent[s])|(store[s] banne[s])"
out: "awning"
- in: "rideau[x]"
Expand Down
1 change: 0 additions & 1 deletion tests/fr/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ tests:
slots:
area: cuisine
device_class:
- "awning"
- "blind"
- "shade"
domain: cover
Expand Down

0 comments on commit 5c0e124

Please sign in to comment.