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

Add new language - Serbian Latin #2796

Merged
merged 45 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5b81399
Please, can you add new language variant - Serbian (latin) - sr-Latn.
darkobg79 Dec 28, 2024
daefe31
Dopuna prevoda...
darkobg79 Dec 28, 2024
ee2c6d2
HassCancelAllTimers
darkobg79 Dec 28, 2024
d8fea90
HassClimateGetTemperature
darkobg79 Dec 28, 2024
c39678b
HassGetCurrentTime
darkobg79 Dec 28, 2024
2e15694
Merge branch 'main' into serbian-latn
darkobg79 Dec 28, 2024
8fba5cb
Completed resonse for Serbian Latin
darkobg79 Dec 28, 2024
1035974
Add sentences 1/2
darkobg79 Dec 28, 2024
276a054
Add complete sentences 2/2
darkobg79 Dec 28, 2024
05fb4f1
Add tests 1/5
darkobg79 Dec 28, 2024
cd62bc4
Add tests 2/5
darkobg79 Dec 29, 2024
721fcc3
Added complete tests 3/5 4/5 and 5/5
darkobg79 Dec 29, 2024
3f50487
Final cleanup... All tests PASSED.
darkobg79 Dec 29, 2024
76cca0f
Merge branch 'main' into serbian-latn
darkobg79 Dec 29, 2024
bb93d49
Add Serbian Latin and Serbian language leader
darkobg79 Dec 29, 2024
12395f4
Cleanup
darkobg79 Dec 29, 2024
67c5ed1
Cleanup
darkobg79 Dec 29, 2024
566ed59
Cleanup
darkobg79 Dec 29, 2024
2e23619
...
darkobg79 Dec 29, 2024
7bdbfe2
..
darkobg79 Dec 29, 2024
3575a3e
Merge branch 'main' into serbian-latn
darkobg79 Dec 29, 2024
6f98579
..
darkobg79 Dec 29, 2024
56041dc
Merge branch 'main' into serbian-latn
darkobg79 Dec 29, 2024
0f6cd76
Merge branch 'main' into serbian-latn
darkobg79 Dec 30, 2024
3a7fa07
Merge branch 'main' into serbian-latn
darkobg79 Dec 31, 2024
f5bca6e
...
darkobg79 Jan 1, 2025
fea55e1
Merge branch 'main' into serbian-latn
darkobg79 Jan 1, 2025
2b09c9a
Merge branch 'main' into serbian-latn
darkobg79 Jan 2, 2025
924f221
Merge branch 'main' into serbian-latn
darkobg79 Jan 2, 2025
6ee5399
Merge branch 'main' into serbian-latn
darkobg79 Jan 3, 2025
913e6b7
Merge branch 'main' into serbian-latn
darkobg79 Jan 3, 2025
55a43f6
Merge branch 'main' into serbian-latn
darkobg79 Jan 4, 2025
7d961e3
Merge branch 'main' into serbian-latn
darkobg79 Jan 4, 2025
3781920
Merge branch 'main' into serbian-latn
darkobg79 Jan 4, 2025
9f91fff
Merge branch 'main' into serbian-latn
darkobg79 Jan 4, 2025
263844d
Merge branch 'main' into serbian-latn
darkobg79 Jan 4, 2025
3921dca
Merge branch 'main' into serbian-latn
darkobg79 Jan 4, 2025
0d84bff
Merge branch 'main' into serbian-latn
darkobg79 Jan 6, 2025
79adf58
Merge branch 'main' into serbian-latn
darkobg79 Jan 6, 2025
f2cd1e0
Merge branch 'main' into serbian-latn
darkobg79 Jan 6, 2025
7ffa91a
Merge branch 'main' into serbian-latn
darkobg79 Jan 7, 2025
c188b7c
Merge branch 'main' into serbian-latn
darkobg79 Jan 8, 2025
b0f4ea5
Merge branch 'main' into serbian-latn
darkobg79 Jan 15, 2025
9a5f56c
Merge branch 'main' into serbian-latn
darkobg79 Jan 16, 2025
d4b021a
Merge branch 'main' into serbian-latn
darkobg79 Jan 17, 2025
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
4 changes: 4 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ sentences/sr/ @cvladan @ddxic
responses/sr/ @cvladan @ddxic
tests/sr/ @cvladan @ddxic

sentences/sr-Latn/ @darkobg79
responses/sr-Latn/ @darkobg79
tests/sr-Latn/ @darkobg79

sentences/sv/ @larsdunemark
responses/sv/ @larsdunemark
tests/sv/ @larsdunemark
Expand Down
4 changes: 4 additions & 0 deletions languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ sr:
leaders:
- cvladan
- ddxic
sr-Latn:
nativeName: Srpski
leaders:
- darkobg79
sv:
nativeName: Svenska
leaders:
Expand Down
20 changes: 20 additions & 0 deletions responses/sr-Latn/HassCancelAllTimers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: sr-Latn
responses:
intents:
HassCancelAllTimers:
default: >
{% if slots.canceled < 1: %}
Nije zaustavljen nijedan tajmer.
{% elif slots.canceled == 1 or slots.canceled % 10 == 1 and slots.canceled % 100 != 11: %}
Zaustavljen je 1 tajmer.
{% else: %}
Zaustavljena su {{ slots.canceled }} tajmera.
{% endif %}
area: >
{% if slots.canceled < 1: %}
Nije zaustavljen nijedan tajmer u prostoriji.
{% elif slots.canceled == 1 or slots.canceled % 10 == 1 and slots.canceled % 100 != 11: %}
Zaustavljen je 1 tajmer u prostoriji.
{% else: %}
Zaustavljeno je {{ slots.canceled }} tajmera u prostoriji.
{% endif %}
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassCancelTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassCancelTimer:
default: "Tajmer je zaustavljen"
8 changes: 8 additions & 0 deletions responses/sr-Latn/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: sr-Latn
responses:
intents:
HassClimateGetTemperature:
default:
"{% set temperature = state_attr(state.entity_id, 'current_temperature')
%} {% if temperature == 1: %} {{ temperature }} stepen {% else: %} {{ temperature
}} stepena {% endif %}"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassClimateSetTemperature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassClimateSetTemperature:
default: Temperatura je postavljena
15 changes: 15 additions & 0 deletions responses/sr-Latn/HassDecreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: sr-Latn
responses:
intents:
HassDecreaseTimer:
default: >
{% set h = slots.hours if slots.hours is defined else none %}
{% set m = slots.minutes if slots.minutes is defined else none %}
{% set s = slots.seconds if slots.seconds is defined else none %}
{% set h_text = h ~ (' sat' if h in ["1", 'jedan'] else ' sata') if h else '' %}
{% set m_text = (30 if m in ['polovina', '1/2'] else m) ~ (' minuta' if m in ["1", 'jedna'] else ' minuta') if m else '' %}
{% set s_text = (30 if s in ['polovina', '1/2'] else s) ~ (' sekunda' if s in ["1", 'jedna'] else ' sekundi') if s else '' %}
{% set text_list = [ h_text, m_text, s_text] | select() | list %}
{% set text = text_list[:-1] | join(', ') ~ ' i ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' i ') %}
{% set name = (' nazvan ' ~ slots.name | trim) if slots.name is defined else '' %}
Tajmer je smanjen za {{ text }}
54 changes: 54 additions & 0 deletions responses/sr-Latn/HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
language: sr-Latn
responses:
intents:
HassGetCurrentDate:
default: >
{% set months = {
1: 'januar',
2: 'februar',
3: 'mart',
4: 'april',
5: 'maj',
6: 'jun',
7: 'jul',
8: 'avgust',
9: 'septembar',
10: 'oktobar',
11: 'novembar',
12: 'decembar',
} %}
{% set ordinal = {
1: '1.',
2: '2.',
3: '3.',
4: '4.',
5: '5.',
6: '6.',
7: '7.',
8: '8.',
9: '9.',
10: '10.',
11: '11.',
12: '12.',
13: '13.',
14: '14.',
15: '15.',
16: '16.',
17: '17.',
18: '18.',
19: '19.',
20: '20.',
21: '21.',
22: '22.',
23: '23.',
24: '24.',
25: '25.',
26: '26.',
27: '27.',
28: '28.',
29: '29.',
30: '30.',
31: '31.',
} %}
{% set weekday = [ 'ponedeljek', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota' , 'nedelja' ] %}
{{ weekday[slots.date.weekday()] }}, {{ slots.date.day }}. {{ months[slots.date.month] }} {{ slots.date.year }}.
7 changes: 7 additions & 0 deletions responses/sr-Latn/HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: sr-Latn
responses:
intents:
HassGetCurrentTime:
default: >
{% set minute_str = '{0:02d}'.format(slots.time.minute) %}
{{ slots.time.hour }}:{{ minute_str }}
82 changes: 82 additions & 0 deletions responses/sr-Latn/HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
language: sr-Latn
responses:
intents:
HassGetState:
default: "{{ state.state_with_unit }}"
one: "{{ slots.name | capitalize }} je {{ state.state_with_unit }}

"
one_yesno: |
{% if query.matched %}
Da
{% else %}
Ne
{% endif %}

any: |
{% if query.matched %}
{% set match = query.matched | map(attribute="name") | sort | list %}
{% if match | length > 4 %}
Da, {{ match[:3] | join(", ") }} i još {{ (match | length - 3) }}
{%- else -%}
Da,
{% for name in match -%}
{% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} i {% endif -%}
{{ name }}
{%- endfor -%}
{% endif %}
{% else %}
Ne
{% endif %}

all: |
{% if not query.unmatched: %}
Da
{% else %}
{% set no_match = query.unmatched | map(attribute="name") | sort | list %}
{% if no_match | length > 4 %}
Ne, nisu {{ no_match[:3] | join(", ") }} i još {{ (no_match | length - 3) }}
{%- else -%}
Ne,
{% if no_match | length > 1 %}
nisu
{%- else -%}
nije
{% endif %}
{% for name in no_match -%}
{% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} i {% endif -%}
{{ name }}
{%- endfor %}
{% endif %}
{% endif %}

which: |
{% if not query.matched %}
Nema {{ slots.state[:-1]}}ih {{ slots.device_class[:-1] }}a
{% else: %}
{% set match = query.matched | map(attribute="name") | sort | list %}
{% if match | length > 4 %}
{{ match[:3] | join(", ") }} i {{ (match | length - 3) }} više
{% else %}
{%- for name in match -%}
{% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} i {% endif -%}
{{ name }}
{%- endfor -%}
{% endif %}
{% endif %}

how_many: |
{{ query.matched | length }}

where: |
{% if state == "not_home" %}
{{ slots.name | capitalize }} je odsutan
{% else %}
{{ slots.name | capitalize }} je na lokaciji {{ state.state}}
{% endif %}

sensor_value: |
Vrednost senzora je {{ state.state_with_unit }}

sensor_value_temperature: |
Temperatura je {{ state.state_with_unit }}
24 changes: 24 additions & 0 deletions responses/sr-Latn/HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: sr-Latn
responses:
intents:
HassGetWeather:
default: >
{% set weather_condition = {
'clear': 'i vedro',
'clear-night': 'i vedra noć',
'cloudy': 'i oblačno',
'exceptional': 'i izuzetno',
'fog': 'sa maglom',
'hail': 'sa gradom',
'lightning': 'sa grmljavinom',
'lightning-rainy': 'sa grmljavinom i kišom',
'partlycloudy': 'i delimično oblačno',
'pouring': 'i jaka kiša',
'rainy': 'i kišovito',
'snowy': 'sa snegom',
'snowy-rainy': 'sa kišom i snegom',
'sunny': 'i sunčano',
'windy': 'i vetrovito',
'windy-variant': 'sa vetrom i oblacima'
} %}
{{ state.attributes.get('temperature') }}{{ state.attributes.get('temperature_unit') }} {{ weather_condition.get((state.state | string).lower(), "") }}
15 changes: 15 additions & 0 deletions responses/sr-Latn/HassIncreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: sr-Latn
responses:
intents:
HassIncreaseTimer:
default: >
{% set h = slots.hours if slots.hours is defined else none %}
{% set m = slots.minutes if slots.minutes is defined else none %}
{% set s = slots.seconds if slots.seconds is defined else none %}
{% set h_text = h ~ (' sat' if h in [ "1", 'jedan'] else ' sata') if h else '' %}
{% set m_text = (30 if m in ['pola', '1/2'] else m) ~ (' minuta' if m in [ "1", 'jedna'] else ' minuta') if m else '' %}
{% set s_text = (30 if s in ['pola', '1/2'] else s) ~ (' sekunda' if s in [ "1", 'jedna'] else ' sekundi') if s else '' %}
{% set text_list = [ h_text, m_text, s_text] | select() | list %}
{% set text = text_list[:-1] | join(', ') ~ ' i ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' i ') %}
{% set name = (' nazvan ' ~ slots.name | trim) if slots.name is defined else '' %}
Vreme je uvećano za {{ text }}
6 changes: 6 additions & 0 deletions responses/sr-Latn/HassLightSet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: sr-Latn
responses:
intents:
HassLightSet:
brightness: "Jačina svetla je postavljena"
color: "Boja svetla je postavljena"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassListAddItem:
item_added: "Dodat {{ slots.item }}"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassMediaNext.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassMediaNext:
default: "OK"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassMediaPause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassMediaPause:
default: "OK"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassMediaPrevious.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassMediaPrevious:
default: "OK"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassMediaUnpause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassMediaUnpause:
default: "OK"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassPauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassPauseTimer:
default: "Tajmer je pauziran"
10 changes: 10 additions & 0 deletions responses/sr-Latn/HassRespond.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: sr-Latn
responses:
intents:
HassRespond:
default: ""
hello: "Pozdrav od Home Assistant."
listening: "Ne, snimam samo kada izgovorite aktivacijsku reč."
data: "Vaši podaci šalju se na vaš Home Assistant server."
commands: "Da biste saznali šta sve možete pitati, posetite stranicu home-assistant.io/voice_control."
creator: "Kreirala me je divna Home Assistant zajednica, sastavljena od entuzijasta iz celog sveta."
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassSetPosition:
default: "Pozicija postavljena"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassSetVolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassSetVolume:
default: "OK"
5 changes: 5 additions & 0 deletions responses/sr-Latn/HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: sr-Latn
responses:
intents:
HassShoppingListAddItem:
shopping_list_item_added: "Stavka je dodata u listu za kupovinu"
25 changes: 25 additions & 0 deletions responses/sr-Latn/HassStartTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: sr-Latn
responses:
intents:
HassStartTimer:
default: >
{% set h = slots.hours if slots.hours is defined else none %}
{% set m = slots.minutes if slots.minutes is defined else none %}
{% set s = slots.seconds if slots.seconds is defined else none %}
{% set h_text = h ~ (' sat' if h in [ "1", 'jedan'] else ' sata') if h else '' %}
{% set m_text = (30 if m in ['pola', 'ipo', '1/2'] else m) ~ (' minuta' if m in [ "1", 'jedna'] else ' minuta') if m else '' %}
{% set s_text = (30 if s in ['pola', 'ipo', '1/2'] else s) ~ (' sekunda' if s in [ "1", 'jedna'] else ' sekundi') if s else '' %}
{% set text_list = [ h_text, m_text, s_text] | select() | list %}
{% set text = text_list[:-1] | join(', ') ~ ' i ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' i ') %}
{% set name = (' nazvan ' ~ slots.name | trim) if slots.name is defined else '' %}
Tajmer je postavljen na {{ text }}{{ name }}
command: >
{% set h = slots.hours if slots.hours is defined else none %}
{% set m = slots.minutes if slots.minutes is defined else none %}
{% set s = slots.seconds if slots.seconds is defined else none %}
{% set h_text = h ~ (' sat' if h in [ "1", 'jedan'] else ' sata') if h else '' %}
{% set m_text = (30 if m in ['pola', '1/2'] else m) ~ (' minuta' if m in [ "1", 'jedna'] else ' minuta') if m else '' %}
{% set s_text = (30 if s in ['pola', '1/2'] else s) ~ (' sekunda' if s in [ "1", 'jedna'] else ' sekundi') if s else '' %}
{% set text_list = [ h_text, m_text, s_text] | select() | list %}
{% set text = text_list[:-1] | join(', ') ~ ' i ' ~ text_list[-1] if text_list | count > 2 else text_list | join(' i ') %}
Naredba će se izvršiti za {{ text }}
Loading
Loading