Skip to content

Commit

Permalink
Add new language - Serbian Latin (#2796)
Browse files Browse the repository at this point in the history
* Please, can you add new language variant - Serbian (latin) - sr-Latn.

Thank you....

* Dopuna prevoda...

* HassCancelAllTimers

* HassClimateGetTemperature
HassClimateSetTemperature

* HassGetCurrentTime
HassGetCurrentDate
HassDecreaseTimer

* Completed resonse for Serbian Latin

* Add sentences 1/2

* Add complete sentences 2/2

* Add tests 1/5

* Add tests 2/5

* Added complete tests 3/5 4/5 and 5/5

* Final cleanup... All tests PASSED.

* Add Serbian Latin and Serbian language leader

* Cleanup

* Cleanup

* Cleanup

* ...

* ..

* ..

* ...
  • Loading branch information
darkobg79 authored Jan 20, 2025
1 parent a980c84 commit 7039dbd
Show file tree
Hide file tree
Showing 126 changed files with 5,000 additions and 0 deletions.
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

0 comments on commit 7039dbd

Please sign in to comment.