Skip to content

Commit

Permalink
[HU] Translation of error messages + handling of articles in the erro…
Browse files Browse the repository at this point in the history
…r message.

Thank you to the contributors of ticket home-assistant#1895. This way, I learned that error messages can be processed :) Following the French model, the Hungarian error messages have now become completely Hungarian. + it also handles the articles of words.

+optimization in the Todo/Shopping list, I reduced the number of variations with the specified suffixes.
  • Loading branch information
v1k70rk4 committed Jan 25, 2024
1 parent e8ed60b commit 2ff0f69
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 7 deletions.
85 changes: 80 additions & 5 deletions sentences/hu/_common.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,87 @@
language: hu
responses:
errors:
no_intent: "Elnézést, ezt nem értettem"
no_area: "{{ area }} terület nem található"
no_domain: "{{ domain }} nem található itt: {{ area }}"
no_device_class: "{{ device_class }} nem található itt: {{ area }}"
no_entity: "{{ entity }} nem található"
no_intent: "Sajnálom, ezt nem értettem."
handle_error: "Váratlan hiba történt."
no_area: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "az" %}
{% else %}
{% set nevelo = "a" %}
{% endif %}
Sajnálom, {{nevelo}} {{ area }} terület nem található.
no_entity: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = entity[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "az" %}
{% else %}
{% set nevelo = "a" %}
{% endif %}
Sajnálom, {{nevelo}} {{ entity }} nem található.
no_domain: |
{% set translations_domains_with_article = {
"button": "gombot",
"camera": "kamerát",
"input_button": "gombot",
"alarm_control_panel": "riasztót",
"automation": "automatizálást",
"fan": "ventilátort",
"climate": "termosztátot",
"humidifier": "párásítót",
"input_boolean": "kapcsolót",
"siren": "szirénát",
"water_heater": "melegvíz-tartályt",
"light": "lámpát",
"switch": "kapcsolót",
"script": "szkriptet",
"remote": "távirányítót",
"lock": "zárat",
"vacuum": "porszívót",
"scene": "jelenetet",
"media_player": "médialejátszót",
"lawn_mower": "fűnyírót",
"valve": "szelepet"
} %}
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "az" %}
{% else %}
{% set nevelo = "a" %}
{% endif %}
{% if domain in translations_domains_with_article %}
Sajnálom, nem találtam {{ translations_domains_with_article[domain] }} {{ nevelo }} {{ area }} területén.
{% else %}
Sajnálom, nem találtam megfelelő eszközt {{ nevelo }} {{ area }} területén.
{% endif %}
no_device_class: |
{% set translations_cover_device_classes_with_article = {
"awning": "napellenzőt",
"blind": "redőnyt",
"curtain": "függönyt",
"door": "ajtót",
"garage": "garázskaput",
"gate": "kaput",
"shade": "árnyékolót",
"shutter": "zsalut",
"window": "ablakot"
} %}
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "az" %}
{% else %}
{% set nevelo = "a" %}
{% endif %}
{% if device_class in translations_cover_device_classes_with_article %}
Sajnálom, nem találtam {{ translations_cover_device_classes_with_article[device_class] }} {{ nevelo }} {{ area }} területén
{% else %}
Sajnálom, nem találtam megfelelő eszközt {{ nevelo }} {{ area }} területén
{% endif %}
lists:
color:
values:
Expand Down
2 changes: 1 addition & 1 deletion sentences/hu/shopping_list_HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ intents:
HassShoppingListAddItem:
data:
- sentences:
- "(Tedd|Rakd) a[z] {shopping_list_item:item} (elemet|tételt) a bevásárló[ ]listá<ragok>"
- "(Tedd|Rakd) a[z] {shopping_list_item:item} (elemet|tételt) a bevásárló[ ]listá[ra|ba|hoz]"
response: item_added
2 changes: 1 addition & 1 deletion sentences/hu/todo_HassListAddItem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ intents:
HassListAddItem:
data:
- sentences:
- "(Tedd|Rakd) a[z] {shopping_list_item:item} (elemet|tételt) a[z] <name>[<ragok>| listá<ragok>]"
- "(Tedd|Rakd) a[z] {shopping_list_item:item} (elemet|tételt) a[z] <name>[<ragok>| listá[ra|ba|hoz]]"
response: item_added
requires_context:
domain: todo

0 comments on commit 2ff0f69

Please sign in to comment.