Skip to content

Commit

Permalink
[HU] Correction of responses. (#1905)
Browse files Browse the repository at this point in the history
* Updating Hungarian intentions

The current intentions are unusable, as they do not employ conjugations at any level. The entire language, which utilizes conjugations, has been updated.

Due to the nature of the Hungarian language, there's an issue where word roots change with conjugation. (For example, if the room is a kitchen, instead of "kapcsold be az összes ventilátort a konyhaban", it should be "konyhában".)

I circumvented these with suffix words, like using "piros színre" instead of "pirosra", or by changing the word order to avoid these issues. This way, it works, like "kapcsold be a konyha összes ventilátorát is."

But for correct and complete Hungarian expressions, it's advisable to use assistant aliases for room names whose endings change with conjugation, such as "szoba" (room), "konyha" (kitchen). For these, "szobá" and "konyhá" aliases should be added.

* Updating Hungarian intentions rev2

* [HU] Added the sensor_HassGetState and the 'in_here' function

with this, the Hungarian translation became 100%

Added the [in here] feature:
cover_HassTurnOff
cover_HassTurnOn
light_HassLightSet
light_HassTurnOff
light_HassTurnOn
fan_HassTurnOff
fan_HassTurnOn

New:
sensor_HassGetState

* [HU] Added the sensor_HassGetState and the 'in_here' function v2

* [hu] More flexible word order, bug fix, +2 color

More flexible word order, especially for lighting
+2 color translations
a minor bug fix
more readable code.

* [hu] More flexible word order, bug fix, +2 color

More flexible word order, especially for lighting
+2 color translations
a minor bug fix
more readable code.

* [hu] More flexible word order, bug fix, +2 color

More flexible word order, especially for lighting
+2 color translations
a minor bug fix
more readable code.

* [hu] bugfix

bugfix
due to the free word order, different suffixes are also needed.

* [hu] bugfix

* bugfix v2

* [HU] Translation of error messages + handling of articles in the error message.

Thank you to the contributors of ticket #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.

* [HU] Optimization of response, handling of articles, correction of number format

I have corrected the responses to put the correct article in front of the word.
The number format correction involves changing 12.1 to 12,1 and replacing "-" with the word "minus".

And an attempt to find out what cover states the live system returns in the live environment. If it's English, then from now on it should also display it in Hungarian; if it's not English, then everything remains as it was.

* [HU] Correction of responses.
  • Loading branch information
v1k70rk4 committed Feb 1, 2024
1 parent cbb0228 commit 205d708
Show file tree
Hide file tree
Showing 18 changed files with 196 additions and 72 deletions.
2 changes: 1 addition & 1 deletion responses/hu/HassClimateSetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: hu
responses:
intents:
HassClimateSetTemperature:
default: "Hőmérséklet beállítva"
default: "A hőmérséklet {{ slots.temperature }} fokra állítva"
82 changes: 66 additions & 16 deletions responses/hu/HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,76 @@ responses:
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} kikapcsolva
lights_area: "A lámpák kikapcsolva"
fans_area: "A ventilátorok kikapcsolva"
fans_all: "Az összes ventilátor kikapcsolva"
cover: "Bezárva"
lock: "Kinyitva"
cover: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.name[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} bezárva
lock: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.name[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} kinyitva
lock_area: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.area }} zárai kinyitva
cover_device_class: |
{% set input_string = slots.device_class %}
{% set device_class_translations = {
"awning": "A napellenző",
"blind": "A redőny",
"curtain": "A függöny",
"door": "Az ajtó",
"garage": "A garázskapu",
"gate": "A kapu",
"shade": "Az árnyékoló",
"shutter": "A zsalu",
"window": "Az ablak"
"garázs": "A garázskapu",
"napellenző": "A napellenző",
"redőny": "A redőny",
"függöny": "A függöny",
"ajtó": "Az ajtó",
"kapu": "A kapu",
"árnyékoló": "Az árnyékoló",
"zsalu": "A zsalu",
"roló": "A roló",
"ablak": "Az ablak"
} %}
{% set device_class = slots.device_class %}
{% if device_class in device_class_translations %}
{{ device_class_translations[device_class] }} bezárva
{% set responses = [] %}
{% for key, value in device_class_translations.items() %}
{% if key in input_string %}
{% set _ = responses.append(value ~ ' bezárva') %}
{% endif %}
{% endfor %}
{% if responses %}
{{ responses[0] }}
{% else %}
Bezárva
{% endif %}
lights_area: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.area }} lámpák kikapcsolva
lights_all: "Az összes lámpa kikapcsolva"
fans_area: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.area }} ventilátorok kikapcsolva
fans_all: "Az összes ventilátor kikapcsolva"
100 changes: 82 additions & 18 deletions responses/hu/HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,92 @@ responses:
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} bekapcsolva
lights_area: "A lámpák bekapcsolva"
light_all: "Az összes lámpa bekapcsolva"
fans_area: "A ventilátorok bekapcsolva"
cover: "Kinyitva"
scene: "Aktiválva"
script: "Elindítva"
lock: "Bezárva"
cover: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.name[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} kinyitva
scene: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.name[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} aktiválva
script: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.name[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} elindítva
lock: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.name[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.name }} bezárva
lock_area: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.area }} zárai bezárva
cover_device_class: |
{% set input_string = slots.device_class %}
{% set device_class_translations = {
"awning": "A napellenző",
"blind": "A redőny",
"curtain": "A függöny",
"door": "Az ajtó",
"garage": "A garázskapu",
"gate": "A kapu",
"shade": "Az árnyékoló",
"shutter": "A zsalu",
"window": "Az ablak"
"garázs": "A garázskapu",
"napellenző": "A napellenző",
"redőny": "A redőny",
"függöny": "A függöny",
"ajtó": "Az ajtó",
"kapu": "A kapu",
"árnyékoló": "Az árnyékoló",
"zsalu": "A zsalu",
"roló": "A roló",
"ablak": "Az ablak"
} %}
{% set device_class = slots.device_class %}
{% if device_class in device_class_translations %}
{{ device_class_translations[device_class] }} kinyitva
{% set responses = [] %}
{% for key, value in device_class_translations.items() %}
{% if key in input_string %}
{% set _ = responses.append(value ~ ' kinyitva') %}
{% endif %}
{% endfor %}
{% if responses %}
{{ responses[0] }}
{% else %}
Kinyitva
{% endif %}
lights_area: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.area }} lámpák bekapcsolva
fans_area: |
{% set magyar_maganhangzok = "aáeéiíoóöőuúüű" %}
{% set elso_betu = slots.area[0].lower() %}
{% if elso_betu in magyar_maganhangzok %}
{% set nevelo = "Az" %}
{% else %}
{% set nevelo = "A" %}
{% endif %}
{{ nevelo }} {{ slots.area }} ventilátorok bekapcsolva
2 changes: 1 addition & 1 deletion sentences/hu/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ expansion_rules:
ragok: "((o|e|ö)n|b(a|e)[n]|h(o|e|ö)z)"
időjáráshelyek: "(város[á]ban|helyen|helységben|településen|faluban)"
zár: "[ajtó|ablak]zár[a[ka]|á][t]"
ventilátor: "[a ]ventilátor[t|át|ok[at]]"
ventilátor: "[a ](ventilátor[t|át|ok[at]]|szellőztetés[t|ét|ek[et]]|(lég|levegő)tisztító[t|ját|kat])"
firmware: "(firmware|förmver|fönn ver|software|szoftver)"
mindenhol: "(minden(hol|ütt))"
otthon: "((o|i)tthon|[a ](házban|lakásban)|jelen)[ van]"
Expand Down
8 changes: 7 additions & 1 deletion sentences/hu/light_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ intents:

- sentences:
- "(<turn_off>; [<minden>] <light>; <area>)"
- "(<turn_off>; <mindenhol>; [<minden>] <light>)"
response: "lights_area"
slots:
domain: "light"
name: "all"

- sentences:
- "(<turn_off>; <mindenhol>; [<minden>] <light>)"
response: "lights_all"
slots:
domain: "light"
name: "all"

#Kikapcsolja a lámpákat azon a területen, ahol az Assist eszköz van
- sentences:
- "(<turn_off>; [<minden>] <light>; [<in_here>])"
Expand Down
2 changes: 1 addition & 1 deletion sentences/hu/lock_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ intents:
slots:
domain: "lock"
name: "all"
response: lock
response: lock_area
2 changes: 1 addition & 1 deletion sentences/hu/lock_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ intents:
slots:
domain: "lock"
name: "all"
response: lock
response: lock_area
6 changes: 3 additions & 3 deletions tests/hu/climate_HassClimateSetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tests:
name: HassClimateSetTemperature
slots:
temperature: 30
response: "Hőmérséklet beállítva"
response: "A hőmérséklet 30 fokra állítva"

- sentences:
- "Állítsd a hőmérsékletet 30 Celsius fokra"
Expand All @@ -19,7 +19,7 @@ tests:
slots:
temperature: 30
temperature_unit: celsius
response: "Hőmérséklet beállítva"
response: "A hőmérséklet 30 fokra állítva"

- sentences:
- "Állítsd be a hőfokot a hálóban 50 Celsius fokra"
Expand All @@ -32,4 +32,4 @@ tests:
area: háló
temperature: 50
temperature_unit: celsius
response: "Hőmérséklet beállítva"
response: "A hőmérséklet 50 fokra állítva"
14 changes: 7 additions & 7 deletions tests/hu/cover_HassTurnOff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
area: konyha
domain: cover
device_class: window
response: "Bezárva"
response: "Az ablak bezárva"

- sentences:
- "Csukd be a konyha ablakot"
Expand All @@ -29,7 +29,7 @@ tests:
area: konyha
domain: cover
device_class: window
response: "Bezárva"
response: "Az ablak bezárva"

- sentences:
- "Húzd be a bal függönyt"
Expand All @@ -41,7 +41,7 @@ tests:
context:
domain: cover
device_class: curtain
response: "Bezárva"
response: "A bal függöny bezárva"

- sentences:
- "Húzd be a bal függönyt a hálóban"
Expand All @@ -54,7 +54,7 @@ tests:
context:
domain: cover
device_class: curtain
response: "Bezárva"
response: "A bal függöny bezárva"

- sentences:
- "Húzd le a redőnyöket a konyhaban"
Expand All @@ -66,7 +66,7 @@ tests:
area: konyha
domain: cover
device_class: blind
response: "Bezárva"
response: "A redőny bezárva"

- sentences:
- "Húzd be a függönyöket a nappaliban"
Expand All @@ -79,7 +79,7 @@ tests:
domain: cover
area: nappali
device_class: curtain
response: "Bezárva"
response: "A függöny bezárva"

- sentences:
- "Húzd be a függönyöket"
Expand All @@ -92,4 +92,4 @@ tests:
domain: cover
area: nappali
device_class: curtain
response: "Bezárva"
response: "A függöny bezárva"
14 changes: 7 additions & 7 deletions tests/hu/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
area: konyha
domain: cover
device_class: window
response: "Kinyitva"
response: "Az ablak kinyitva"

- sentences:
- "Nyisd ki a konyha ablakot"
Expand All @@ -29,7 +29,7 @@ tests:
area: konyha
domain: cover
device_class: window
response: "Kinyitva"
response: "Az ablak kinyitva"

- sentences:
- "Húzd el a bal függönyt"
Expand All @@ -41,7 +41,7 @@ tests:
context:
domain: cover
device_class: curtain
response: "Kinyitva"
response: "A bal függöny kinyitva"

- sentences:
- "Húzd el a bal függönyt a hálóban"
Expand All @@ -54,7 +54,7 @@ tests:
context:
domain: cover
device_class: curtain
response: "Kinyitva"
response: "A bal függöny kinyitva"

- sentences:
- "Húzd fel a redőnyöket a konyhaban"
Expand All @@ -66,7 +66,7 @@ tests:
area: konyha
domain: cover
device_class: blind
response: "Kinyitva"
response: "A redőny kinyitva"

- sentences:
- "Húzd el a függönyöket a nappaliban"
Expand All @@ -79,7 +79,7 @@ tests:
domain: cover
area: nappali
device_class: curtain
response: "Kinyitva"
response: "A függöny kinyitva"

- sentences:
- "Húzd el a függönyöket"
Expand All @@ -92,4 +92,4 @@ tests:
domain: cover
area: nappali
device_class: curtain
response: "Kinyitva"
response: "A függöny kinyitva"
Loading

0 comments on commit 205d708

Please sign in to comment.