Skip to content

Commit

Permalink
Migrate errors (home-assistant#1906)
Browse files Browse the repository at this point in the history
* Migrate errors

* Rename device to entity
  • Loading branch information
synesthesiam authored and schizza committed Mar 16, 2024
1 parent 31ef9d8 commit 20de9da
Show file tree
Hide file tree
Showing 58 changed files with 161 additions and 121 deletions.
23 changes: 17 additions & 6 deletions script/intentfest/add_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,23 @@ def run() -> int:
"language": language,
"responses": {
"errors": {
"no_intent": "TODO: Sorry, I couldn't understand that",
"no_area": "TODO: No area named {{ area }}",
"no_domain": "TODO: {{ area }} does not contain a {{ domain }}",
"no_device_class": "TODO: {{ area }} does not contain a {{ device_class }}",
"no_entity": "TODO: No device or entity named {{ entity }}",
"handle_error": "TODO: An unexpected error occurred while handling the intent",
"no_intent": "TODO Sorry, I couldn't understand that",
"handle_error": "TODO An unexpected error occurred",
"no_area": "TODO Sorry, I am not aware of any area called {{ area }}",
"no_domain": "TODO Sorry, I am not aware of any {{ domain }}",
"no_domain_in_area": "TODO Sorry, I am not aware of any {{ domain }} in the {{ area }} area",
"no_device_class": "TODO Sorry, I am not aware of any {{ device_class }}",
"no_device_class_in_area": "TODO Sorry, I am not aware of any {{ device_class }} in the {{ area }} area",
"no_entity": "TODO Sorry, I am not aware of any device called {{ entity }}",
"no_entity_in_area": "TODO Sorry, I am not aware of any device called {{ entity }} in the {{ area }} area",
"no_entity_exposed": "TODO Sorry, {{ entity }} is not exposed",
"no_entity_in_area_exposed": "TODO Sorry, {{ entity }} in the {{ area }} area is not exposed",
"no_domain_exposed": "TODO Sorry, no {{ domain }} is exposed",
"no_domain_in_area_exposed": "TODO Sorry, no {{ domain }} in the {{ area }} area is exposed",
"no_device_class_exposed": "TODO Sorry, no {{ device_class }} is exposed",
"no_device_class_in_area_exposed": "TODO Sorry, no {{ device_class }} in the {{ area }} area is exposed",
"duplicate_entities": "TODO Sorry, there are multiple devices called {{ entity }}",
"duplicate_entities_in_area": "TODO Sorry, there are multiple devices called {{ entity }} in the {{ area }} area",
},
},
"lists": {},
Expand Down
13 changes: 12 additions & 1 deletion script/intentfest/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,22 @@ def validate(value):

INTENT_ERRORS = {
"no_intent",
"handle_error",
"no_area",
"no_domain",
"no_domain_in_area",
"no_device_class",
"no_device_class_in_area",
"no_entity",
"handle_error",
"no_entity_in_area",
"no_entity_exposed",
"no_entity_in_area_exposed",
"no_domain_exposed",
"no_domain_in_area_exposed",
"no_device_class_exposed",
"no_device_class_in_area_exposed",
"duplicate_entities",
"duplicate_entities_in_area",
}

SENTENCE_MATCHER = vol.All(
Expand Down
4 changes: 2 additions & 2 deletions sentences/af/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Jammer, ek verstaan nie"
no_area: "Geen area genaamd {{ area }}"
no_domain: "{{ area }} bevat (nie|geen) {{ domain }}"
no_device_class: "{{ area }} bevat (nie|geen) {{ device_class }}"
no_domain_in_area: "{{ area }} bevat (nie|geen) {{ domain }}"
no_device_class_in_area: "{{ area }} bevat (nie|geen) {{ device_class }}"
no_entity: "Geen toestel of entiteit (genaamd|met die naam) {{ entity }}"
handle_error: "'n Onverwagse fout het voorgekom tydens die hanteering van die voorneme'"
lists: {}
Expand Down
4 changes: 2 additions & 2 deletions sentences/ar/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "عفوا, لم افهم هذا"
no_area: "لا توجد منطقة بالأسم {{ area }}"
no_domain: "النطاق {{ domain }} غير موجود بالمنطقة {{ area }}"
no_device_class: "المنطقة {{ area }} لا تحتوى على فئة الأجهزة {{ device_class }}"
no_domain_in_area: "النطاق {{ domain }} غير موجود بالمنطقة {{ area }}"
no_device_class_in_area: "المنطقة {{ area }} لا تحتوى على فئة الأجهزة {{ device_class }}"
no_entity: "لا يوجد جهاز او خاصية بالأسم {{ entity }}"
handle_error: "حدث خطأ اثناء معالجة النص"

Expand Down
4 changes: 2 additions & 2 deletions sentences/bg/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: Съжалявам, не можах да разбера това
no_area: Няма област с име {{ area }}
no_domain: В областта {{ area }} няма {{ domain }}
no_device_class: В областта {{ area }} няма {{ device_class }}
no_domain_in_area: В областта {{ area }} няма {{ domain }}
no_device_class_in_area: В областта {{ area }} няма {{ device_class }}
no_entity: Няма устройство или обект с име {{ entity }}
handle_error: Възникна неочаквана грешка при изпълнение на командата
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/bn/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: “দুঃখিত আমি বুঝতে পারিনি”
no_area: “{{ area }} এর ক্ষেত্র আগে উঠানো হয়নি ”
no_domain: “{{ area }} এরমধ্যে {{ domain }} নেই”
no_device_class: “{{ area }} এরমধ্যে {{ device_class }} নেই
no_domain_in_area: “{{ area }} এরমধ্যে {{ domain }} নেই”
no_device_class_in_area: “{{ area }} এরমধ্যে {{ device_class }} নেই
no_entity: “এই নামে কোন মেশিন বা {{ entity }} নামে কিছু নেই”
handle_error: “কাজটি শেষ করার আগে অপ্রত্যাশিত একটি ভুলসংঘটিত হয়েছে”
lists: {}
Expand Down
4 changes: 2 additions & 2 deletions sentences/ca/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: Ho sento, no entenc això
no_area: No hi ha l'àrea {{ area }}
no_domain: No hi ha {{ domain }} a {{ area }}
no_device_class: No hi ha {{ device_class }} a {{ area }}
no_domain_in_area: No hi ha {{ domain }} a {{ area }}
no_device_class_in_area: No hi ha {{ device_class }} a {{ area }}
no_entity: No hi ha cap dispositiu o entitat que es digui {{ entity }}
handle_error: He trobat un error inesperat mentre feia l'intent
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/cs/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Omlouvám se, ale nerozumím"
no_area: "Oblast {{ area }} nenalezena"
no_domain: "{{ area }} neobsahuje {{ domain }}"
no_device_class: "{{ area }} neobsahuje {{ device_class }}"
no_domain_in_area: "{{ area }} neobsahuje {{ domain }}"
no_device_class_in_area: "{{ area }} neobsahuje {{ device_class }}"
no_entity: "Žádné zařízení ani entita se nejmenuje {{ entity }}"
handle_error: "Při zpracování došlo k neočekávané chybě"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/da/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Undskyld, det forstod jeg ikke"
no_area: "Området med navnet {{ area }} findes ikke"
no_domain: "{{ domain }} findes ikke i området {{ area }}"
no_device_class: "{{ device_class }} findes ikke i området {{ area }}"
no_domain_in_area: "{{ domain }} findes ikke i området {{ area }}"
no_device_class_in_area: "{{ device_class }} findes ikke i området {{ area }}"
no_entity: "{{ entity }} findes ikke"
handle_error: "Der opstod en uventet fejl under håndtering af hensigten"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/de-CH/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Tschuldigung, das han i nid verstande"
no_area: "S'git ke Bereich {{area}}"
no_domain: "Im Bereich {{area}} git's kes Grät vor Kategorie {{domain}}"
no_device_class: "Im Bereich {{area}} het's kes Grät vor Klass {{device_class}}"
no_domain_in_area: "Im Bereich {{area}} git's kes Grät vor Kategorie {{domain}}"
no_device_class_in_area: "Im Bereich {{area}} het's kes Grät vor Klass {{device_class}}"
no_entity: "Ds Grät {{entity}} gids nid"
handle_error: "Es isch en unerwartete Fähler ufträte bi der Verarbeitig vom Befäu."
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/de/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Entschuldigung, das habe ich nicht verstanden"
no_area: "Kein Bereich mit dem Namen {{ area }} vorhanden"
no_domain: "{{ domain }} ist nicht im Bereich {{ area }} vorhanden"
no_device_class: "{{ device_class }} ist nicht im Bereich {{ area }} vorhanden"
no_domain_in_area: "{{ domain }} ist nicht im Bereich {{ area }} vorhanden"
no_device_class_in_area: "{{ device_class }} ist nicht im Bereich {{ area }} vorhanden"
no_entity: "{{ entity }} existiert nicht"
handle_error: "Es ist ein unerwarteter Fehler aufgetreten"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/el/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Συγγνώμη, δεν μπόρεσα να το καταλάβω αυτό"
no_area: "Δεν υπάρχει περιοχή με όνομα {{ area }}"
no_domain: "Η περιοχή {{ area }} δεν περιέχει ένα {{ domain }}"
no_device_class: "Η περιοχή {{ area }} δεν περιέχει {{ device_class }}"
no_domain_in_area: "Η περιοχή {{ area }} δεν περιέχει ένα {{ domain }}"
no_device_class_in_area: "Η περιοχή {{ area }} δεν περιέχει {{ device_class }}"
no_entity: "Δεν υπάρχει συσκευή ή οντότητα με όνομα {{ entity }}"
handle_error: "Προέκυψε ένα απροσδόκητο σφάλμα κατά το χειρισμό της πρόθεσης"
lists:
Expand Down
26 changes: 22 additions & 4 deletions sentences/en/_common.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
language: "en"
responses:
errors:
# General errors
no_intent: "Sorry, I couldn't understand that"
handle_error: "An unexpected error occurred"

# Errors for when user is not logged in
no_area: "Sorry, I am not aware of any area called {{ area }}"
no_domain: "Sorry, I am not aware of any {{ domain }} in the {{ area }} area"
no_device_class: "Sorry, I am not aware of any {{ device_class }} in the {{ area }} area"
no_entity: "Sorry, I am not aware of any device or entity called {{ entity }}"
handle_error: "An unexpected error occurred while handling the intent"
no_domain: "Sorry, I am not aware of any {{ domain }}"
no_domain_in_area: "Sorry, I am not aware of any {{ domain }} in the {{ area }} area"
no_device_class: "Sorry, I am not aware of any {{ device_class }}"
no_device_class_in_area: "Sorry, I am not aware of any {{ device_class }} in the {{ area }} area"
no_entity: "Sorry, I am not aware of any device called {{ entity }}"
no_entity_in_area: "Sorry, I am not aware of any device called {{ entity }} in the {{ area }} area"

# Errors for when user is logged in and we can give more information
no_entity_exposed: "Sorry, {{ entity }} is not exposed"
no_entity_in_area_exposed: "Sorry, {{ entity }} in the {{ area }} area is not exposed"
no_domain_exposed: "Sorry, no {{ domain }} is exposed"
no_domain_in_area_exposed: "Sorry, no {{ domain }} in the {{ area }} area is exposed"
no_device_class_exposed: "Sorry, no {{ device_class }} is exposed"
no_device_class_in_area_exposed: "Sorry, no {{ device_class }} in the {{ area }} area is exposed"

# Used when multiple (exposed) devices have the same name
duplicate_entities: "Sorry, there are multiple devices called {{ entity }}"
duplicate_entities_in_area: "Sorry, there are multiple devices called {{ entity }} in the {{ area }} area"
lists:
color:
values:
Expand Down
4 changes: 2 additions & 2 deletions sentences/es/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Lo siento, no he entendido"
no_area: "Lo siento, no conozco ningún área llamada {{ area }}"
no_domain: "Lo siento, no conozco ningún elemento de tipo {{ domain }} en el área {{ area }}"
no_device_class: "Lo siento, no conozco ningún elemento de clase {{ device_class }} en el área {{ area }}"
no_domain_in_area: "Lo siento, no conozco ningún elemento de tipo {{ domain }} en el área {{ area }}"
no_device_class_in_area: "Lo siento, no conozco ningún elemento de clase {{ device_class }} en el área {{ area }}"
no_entity: "Lo siento, no conozco ningún dispositivo o entidad llamado {{ entity }}"
handle_error: "Se ha producido un error inesperado al procesar la instrucción"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/et/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Vabandust, ma ei saanud aru"
no_area: "Puudub ala nimega {{ area }}"
no_domain: "{{ area }} ei sisalda {{ domain }}"
no_device_class: "{{ area }} ei sisalda {{ device_class }}"
no_domain_in_area: "{{ area }} ei sisalda {{ domain }}"
no_device_class_in_area: "{{ area }} ei sisalda {{ device_class }}"
no_entity: "Puudub seade või üksus nimega {{ entity }}"
handle_error: "Soovi töötlemisel tekkis tundmatu viga"
lists: {}
Expand Down
4 changes: 2 additions & 2 deletions sentences/eu/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Barkatu, ez dizut ulertu"
no_area: "Ez dago {{ area }} izeneko gunerik"
no_domain: "{{ area }} guneak ez dauka {{ domain }} moduko elementurik"
no_device_class: "Ez dago {{ device_class }} motako elementurik {{ area }} gunean"
no_domain_in_area: "{{ area }} guneak ez dauka {{ domain }} moduko elementurik"
no_device_class_in_area: "Ez dago {{ device_class }} motako elementurik {{ area }} gunean"
no_entity: "Ez da {{ entity }} izeneko gailu edo entitaterik existitzen"
handle_error: "Espero ez zen errore bat gertatu da agindua prozesatzean"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/fa/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "ببخشید نتونستم بفهمم"
no_area: "وجود ندارد {{ area }} هیچ منطقه ای به نام"
no_domain: "نیست {{ domain }} دارای {{ area }}"
no_device_class: "نیست {{ device_class }} دارای {{ area }}"
no_domain_in_area: "نیست {{ domain }} دارای {{ area }}"
no_device_class_in_area: "نیست {{ device_class }} دارای {{ area }}"
no_entity: "وجود ندارد {{ entity }} هیچ دستگاه یا موجودی به نام"
handle_error: "هنگام اجرای هدف یک خطای غیر منتظره بوجود آمد "
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/fi/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Olen pahoillani, en ymmärrä mitä tarkoitat"
no_area: "Ei ole aluetta nimellä {{ area }}"
no_domain: "{{ area }} ei sisällä {{ domain }}"
no_device_class: "{{ area }} ei sisällä {{ device_class }}"
no_domain_in_area: "{{ area }} ei sisällä {{ domain }}"
no_device_class_in_area: "{{ area }} ei sisällä {{ device_class }}"
no_entity: "Ei laitetta tai kohdetta nimellä {{ entity }}"
handle_error: "Asian käsittelyssä tapahtui odottamaton ongelma"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/fr-CA/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ 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_domain_in_area: "{{ area }} ne contient pas de {{ domain }}"
no_device_class_in_area: "{{ area }} ne contient pas de {{ device_class }}"
no_entity: "Aucun appareil ou entité appelé {{ entity }}"
handle_error: "Une erreur s'est produite pendant le traitement"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/fr/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ responses:
errors:
no_intent: "Désolé, je n'ai pas compris"
no_area: "Désolé, je ne connais pas la pièce {{ area }}"
no_domain: |
no_domain_in_area: |
{% set translations_domains_with_article = {
"button": "de boutons",
"camera": "de caméras",
Expand Down Expand Up @@ -32,7 +32,7 @@ responses:
{% else %}
Désolé, je n'ai rien trouvé de correspondant dans {{ area }}
{% endif %}
no_device_class: |
no_device_class_in_area: |
{% set translations_cover_device_classes_with_article = {
"awning": "d'auvents",
"blind": "de stores",
Expand Down
4 changes: 2 additions & 2 deletions sentences/gl/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: Síntoo, non che entendín
no_area: Non existe ningunha área chamada {{ area }}
no_domain: "{{ area }} non ten {{ domain }}"
no_device_class: "{{ area }} non ten {{ device_class }}"
no_domain_in_area: "{{ area }} non ten {{ domain }}"
no_device_class_in_area: "{{ area }} non ten {{ device_class }}"
no_entity: Non existe dispositivo ou entidade chamado {{ entity }}
handle_error: Un erro inesperado ocurreu intentando procesar a instrucción
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/gu/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "માફ કરશો, મને તે સમજાયું નહીં"
no_area: "{{ area }} નામનો કોઈ વિસ્તાર નથી"
no_domain: "{{ area }} માં {{ domain }} નથી"
no_device_class: "{{ area }} માં {{ device_class }} નથી"
no_domain_in_area: "{{ area }} માં {{ domain }} નથી"
no_device_class_in_area: "{{ area }} માં {{ device_class }} નથી"
no_entity: "{{ entity }} નામનું કોઈ ડીવાઇસ અથવા એન્ટિટી નથી"
handle_error: "ઈન્ટેન્ટ સંભાળતી વખતે એક અણધારી ભૂલ આવી"
lists: {}
Expand Down
4 changes: 2 additions & 2 deletions sentences/he/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "סליחה, לא הבנתי את זה"
no_area: "אין שטח בשם {{ area }}"
no_domain: "אין {{ domain }} ב{{ area }}"
no_device_class: "אין {{ device_class }} ב{{ area }}"
no_domain_in_area: "אין {{ domain }} ב{{ area }}"
no_device_class_in_area: "אין {{ device_class }} ב{{ area }}"
no_entity: "אין התקן או יישות בשם {{ entity }}"
handle_error: "שגיאה בלתי צפויה בעת עיבוד הבקשה"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/hi/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "क्षमा करें, मुझे यह समझ में नहीं आया"
no_area: "{{ area }} नाम का कोई क्षेत्र नहीं है"
no_domain: "{{ area }} नाम के क्षेत्र में कोई {{ domain }} नहीं है"
no_device_class: "{{ area }} नाम के क्षेत्र में कोई {{ device_class }} नहीं है"
no_domain_in_area: "{{ area }} नाम के क्षेत्र में कोई {{ domain }} नहीं है"
no_device_class_in_area: "{{ area }} नाम के क्षेत्र में कोई {{ device_class }} नहीं है"
no_entity: "{{ entity }} नाम का कोई डिवाइस या एंटिटी नहीं है"
handle_error: "इंटेंट को संभालते समय एक अनपेक्षित एरर हुआ"
lists: {}
Expand Down
4 changes: 2 additions & 2 deletions sentences/hr/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ responses:
errors:
no_intent: "Nažalost, ne razumijem zahtjev"
no_area: "Prostorija s imenom {{ area }} ne postoji"
no_domain: "Ne postoji {{ domain }} u prostoriji {{ area }}"
no_device_class: "Prostorija {{ area }} ne sadrži {{ device_class }}"
no_domain_in_area: "Ne postoji {{ domain }} u prostoriji {{ area }}"
no_device_class_in_area: "Prostorija {{ area }} ne sadrži {{ device_class }}"
no_entity: "Ne postoji uređaj ili entitet pod imenom {{ entity }}"
handle_error: "Došlo je do neočekivane pogreške prilikom obrade zahtjeva"
lists:
Expand Down
4 changes: 2 additions & 2 deletions sentences/hu/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ responses:
{% set nevelo = "a" %}
{% endif %}
Sajnálom, {{nevelo}} {{ entity }} nem található.
no_domain: |
no_domain_in_area: |
{% set translations_domains_with_article = {
"button": "gombot",
"camera": "kamerát",
Expand Down Expand Up @@ -57,7 +57,7 @@ responses:
{% else %}
Sajnálom, nem találtam megfelelő eszközt {{ nevelo }} {{ area }} területén.
{% endif %}
no_device_class: |
no_device_class_in_area: |
{% set translations_cover_device_classes_with_article = {
"awning": "napellenzőt",
"blind": "redőnyt",
Expand Down
Loading

0 comments on commit 20de9da

Please sign in to comment.