Skip to content

Commit

Permalink
[TH] Add language Thai (home-assistant#2412)
Browse files Browse the repository at this point in the history
* add language th

* add test for hass turn off
  • Loading branch information
Zixties60 authored Oct 15, 2024
1 parent e1e9958 commit 8a33a02
Show file tree
Hide file tree
Showing 119 changed files with 977 additions and 1 deletion.
3 changes: 2 additions & 1 deletion languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ fr:
leaders:
- jlpouffier
- piitaya

fr-CA:
nativeName: Français (Canada)
leaders:
Expand Down Expand Up @@ -191,6 +190,8 @@ sw:
- BCorbeek
te:
nativeName: తెలుగు
th:
nativeName: ภาษาไทย
tr:
nativeName: Türkçe
leaders:
Expand Down
5 changes: 5 additions & 0 deletions responses/th/HassCancelTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassCancelTimer:
default: "TODO: Timer cancelled"
10 changes: 10 additions & 0 deletions responses/th/HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: th
responses:
intents:
HassClimateGetTemperature:
default:
"TODO: {% set temperature = state_attr(state.entity_id, 'current_temperature')
%} {% if temperature == 1: %} {{ temperature }} degree {% else: %} {{ temperature
}} degrees {% endif %}
"
5 changes: 5 additions & 0 deletions responses/th/HassClimateSetTemperature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassClimateSetTemperature:
default: "TODO: Temperature set"
5 changes: 5 additions & 0 deletions responses/th/HassDecreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassDecreaseTimer:
default: "TODO: Timer updated"
17 changes: 17 additions & 0 deletions responses/th/HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: th
responses:
intents:
HassGetCurrentDate:
default:
"TODO: {% set months = {\n 1: 'January',\n 2: 'February',\n 3:\
\ 'March',\n 4: 'April',\n 5: 'May',\n 6: 'June',\n 7: 'July',\n \
\ 8: 'August',\n 9: 'September',\n 10: 'October',\n 11: 'November',\n\
\ 12: 'December',\n} %} {% set ordinal = {\n 1: '1st',\n 2: '2nd',\n\
\ 3: '3rd',\n 4: '4th',\n 5: '5th',\n 6: '6th',\n 7: '7th',\n \
\ 8: '8th',\n 9: '9th',\n 10: '10th',\n 11: '11th',\n 12: '12th',\n\
\ 13: '13th',\n 14: '14th',\n 15: '15th',\n 16: '16th',\n 17: '17th',\n\
\ 18: '18th',\n 19: '19th',\n 20: '20th',\n 21: '21st',\n 22: '22nd',\n\
\ 23: '23rd',\n 24: '24th',\n 25: '25th',\n 26: '26th',\n 27: '27th',\n\
\ 28: '28th',\n 29: '29th',\n 30: '30th',\n 31: '31st',\n } %}\n{{\
\ months[slots.date.month] }} {{ ordinal[slots.date.day] }}, {{ slots.date.year\
\ }}\n"
10 changes: 10 additions & 0 deletions responses/th/HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: th
responses:
intents:
HassGetCurrentTime:
default: "TODO: {% set minute_str = '{0:02d}'.format(slots.time.minute) %}
{% if slots.time.hour <= 12: %} {{ slots.time.hour }}:{{ minute_str }} AM
{% else: %} {{ slots.time.hour - 12 }}:{{ minute_str }} PM {% endif %}
"
43 changes: 43 additions & 0 deletions responses/th/HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
language: th
responses:
intents:
HassGetState:
default: "TODO: {{ state.state_with_unit }}"
one: "TODO: {{ slots.name | capitalize }} is {{ state.state_with_unit }}
"
one_yesno:
"TODO: {% if query.matched %}\n Yes\n{% else %}\n No, {{ state.state_with_unit\
\ }}\n{% endif %}\n"
any:
"TODO: {% if query.matched %}\n {% set match = query.matched | map(attribute=\"\
name\") | sort | list %}\n {% if match | length > 4 %}\n Yes, {{ match[:3]\
\ | join(\", \") }} and {{ (match | length - 3) }} more\n {%- else -%}\n\
\ Yes,\n {% for name in match -%}\n {% if not loop.first and not\
\ loop.last %}, {% elif loop.last and not loop.first %} and {% endif -%}\n\
\ {{ name }}\n {%- endfor -%}\n {% endif %}\n{% else %}\n No\n{%\
\ endif %}\n"
all:
"TODO: {% if not query.unmatched: %}\n Yes\n{% else %}\n {% set no_match\
\ = query.unmatched | map(attribute=\"name\") | sort | list %}\n {% if no_match\
\ | length > 4 %}\n No, {{ no_match[:3] | join(\", \") }} and {{ (no_match\
\ | length - 3) }} more are not {{ slots.state }}\n {%- else -%}\n No,\n\
\ {% for name in no_match -%}\n {% if not loop.first and not loop.last\
\ %}, {% elif loop.last and not loop.first %} and {% endif -%}\n {{ name\
\ }}\n {%- endfor %} {% if no_match | length > 1 %}are{% else %}is{% endif\
\ %} not {{ slots.state }}\n {% endif %}\n{% endif %}\n"
which:
"TODO: {% if not query.matched %}\n Not any\n{% else: %}\n {% set match\
\ = query.matched | map(attribute=\"name\") | sort | list %}\n {% if match\
\ | length > 4 %}\n {{ match[:3] | join(\", \") }} and {{ (match | length\
\ - 3) }} more\n {% else %}\n {%- for name in match -%}\n {% if not\
\ loop.first and not loop.last %}, {% elif loop.last and not loop.first %}\
\ and {% endif -%}\n {{ name }}\n {%- endfor -%}\n {% endif %}\n\
{% endif %}\n"
how_many: "TODO: {{ query.matched | length }}
"
where:
"TODO: {% if state == \"not_home\" %}\n {{ slots.name | capitalize }}\
\ is away\n{% else %}\n {{ slots.name | capitalize }} is at {{ state.state\
\ }}\n{% endif %}\n"
14 changes: 14 additions & 0 deletions responses/th/HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: th
responses:
intents:
HassGetWeather:
default:
"TODO: {% set weather_condition = {\n 'clear': 'and clear',\n 'clear-night':\
\ 'and clear',\n 'cloudy': 'and cloudy',\n 'exceptional': 'and exceptional',\n\
\ 'fog': 'with fog',\n 'hail': 'with hail',\n 'lightning': 'with lightning',\n\
\ 'lightning-rainy': 'with lightning and rain',\n 'partlycloudy': 'and partly\
\ cloudy',\n 'pouring': 'and pouring rain',\n 'rainy': 'and raining',\n\
\ 'snowy': 'and snowing',\n 'snowy-rainy': 'with snow and rain',\n 'sunny':\
\ 'and sunny',\n 'windy': 'and windy',\n 'windy-variant': 'with wind and\
\ clouds'\n} %} {{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit')\
\ }} {{ weather_condition.get((state.state | string).lower(), \"\") }}\n"
5 changes: 5 additions & 0 deletions responses/th/HassIncreaseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassIncreaseTimer:
default: "TODO: Timer updated"
6 changes: 6 additions & 0 deletions responses/th/HassLightSet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: th
responses:
intents:
HassLightSet:
brightness: "TODO: Brightness set"
color: "TODO: Color set"
5 changes: 5 additions & 0 deletions responses/th/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassListAddItem:
item_added: "TODO: Added {{ slots.item }}"
5 changes: 5 additions & 0 deletions responses/th/HassMediaNext.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassMediaNext:
default: "TODO: Playing next"
5 changes: 5 additions & 0 deletions responses/th/HassMediaPause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassMediaPause:
default: "TODO: Paused"
5 changes: 5 additions & 0 deletions responses/th/HassMediaPrevious.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassMediaPrevious:
default: "TODO: Playing previous"
5 changes: 5 additions & 0 deletions responses/th/HassMediaUnpause.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassMediaUnpause:
default: "TODO: Resumed"
5 changes: 5 additions & 0 deletions responses/th/HassPauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassPauseTimer:
default: "TODO: Timer paused"
5 changes: 5 additions & 0 deletions responses/th/HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassSetPosition:
default: "TODO: Position set"
5 changes: 5 additions & 0 deletions responses/th/HassSetVolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassSetVolume:
default: "TODO: Volume set"
5 changes: 5 additions & 0 deletions responses/th/HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassShoppingListAddItem:
item_added: "TODO: Added {{ slots.item }}"
6 changes: 6 additions & 0 deletions responses/th/HassStartTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: th
responses:
intents:
HassStartTimer:
default: "TODO: Timer started"
command: "TODO: Command received"
48 changes: 48 additions & 0 deletions responses/th/HassTimerStatus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
language: th
responses:
intents:
HassTimerStatus:
default:
"TODO: {% set num_timers = slots.timers | length %}\n{% set active_timers\
\ = slots.timers | selectattr('is_active') | list %}\n{% set num_active_timers\
\ = active_timers | length %}\n{% set paused_timers = slots.timers | rejectattr('is_active')\
\ | list %}\n{% set num_paused_timers = paused_timers | length %}\n{% set\
\ next_timer = None %}\n\n{% if num_timers == 0: %}\n No timers.\n{% elif\
\ num_active_timers == 0: %}\n {# No active timers #}\n {% if num_paused_timers\
\ == 1: %}\n {% set next_timer = paused_timers[0] %}\n Timer is paused.\n\
\ {% else: %}\n {{ num_paused_timers }} paused timers.\n {% endif %}\n\
{% else: %}\n {# At least one active timer #}\n {% if num_active_timers\
\ == 1: %}\n {% set next_timer = active_timers[0] %}\n {% else: %}\n \
\ {# Get active timer that will finish soonest #}\n {% set sorted_timers\
\ = active_timers | sort(attribute='total_seconds_left') %}\n {% set next_timer\
\ = sorted_timers[0] %}\n {{ num_active_timers }} running timers.\n {%\
\ endif %}\n\n {% if num_paused_timers == 1: %}\n 1 paused timer.\n {%\
\ elif num_paused_timers > 0: %}\n {{ num_paused_timers }} paused timers.\n\
\ {% endif %}\n{% endif %}\n\n{% if next_timer: %}\n {# At least one active\
\ timer #}\n {% if (next_timer.rounded_hours_left == 1) and (next_timer.rounded_minutes_left\
\ > 0): %}\n 1 hour and {{ next_timer.rounded_minutes_left }} minutes\n\
\ {% elif (next_timer.rounded_hours_left == 1): %}\n 1 hour\n {% elif\
\ (next_timer.rounded_hours_left > 1) and (next_timer.rounded_minutes_left\
\ > 0): %}\n {{ next_timer.rounded_hours_left }} hours and {{ next_timer.rounded_minutes_left\
\ }} minutes\n {% elif (next_timer.rounded_hours_left > 1): %}\n {{ next_timer.rounded_hours_left\
\ }} hours\n {% elif (next_timer.rounded_minutes_left == 1) and (next_timer.rounded_seconds_left\
\ > 0): %}\n 1 minute and {{ next_timer.rounded_seconds_left }} seconds\n\
\ {% elif (next_timer.rounded_minutes_left == 1): %}\n 1 minute\n {%\
\ elif (next_timer.rounded_minutes_left > 1) and (next_timer.rounded_seconds_left\
\ > 0): %}\n {{ next_timer.rounded_minutes_left }} minutes and {{ next_timer.rounded_seconds_left\
\ }} seconds\n {% elif (next_timer.rounded_minutes_left > 1): %}\n {{\
\ next_timer.rounded_minutes_left }} minutes\n {% elif (next_timer.rounded_seconds_left\
\ == 1): %}\n 1 second\n {% elif (next_timer.rounded_seconds_left > 1):\
\ %}\n {{ next_timer.rounded_seconds_left }} seconds\n {% endif %}\n\n\
\ {% if num_timers > 1: %}\n {# Give some extra information to disambiguate\
\ #}\n left on\n {% if (next_timer.start_hours > 0) and (next_timer.start_minutes\
\ > 0): %}\n {{ next_timer.start_hours }} hour and {{ next_timer.start_minutes\
\ }} minute\n {% elif (next_timer.start_hours > 0): %}\n {{ next_timer.start_hours\
\ }} hour\n {% elif (next_timer.start_minutes > 0) and (next_timer.start_seconds\
\ > 0): %}\n {{ next_timer.start_minutes }} minute and {{ next_timer.start_seconds\
\ }} second\n {% elif (next_timer.start_minutes > 0): %}\n {{ next_timer.start_minutes\
\ }} minute\n {% elif (next_timer.start_seconds > 0): %}\n {{ next_timer.start_seconds\
\ }} second\n {% endif %}\n\n {% if next_timer.name: %}\n {{ next_timer.name\
\ }}\n {% elif next_timer.area: %}\n {{ next_timer.area }}\n {%\
\ endif %}\n\n timer.\n {% else: %}\n left.\n {% endif %}\n{% endif\
\ %}\n"
14 changes: 14 additions & 0 deletions responses/th/HassTurnOff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: th
responses:
intents:
HassTurnOff:
default: "TODO: Turned off the {{ state.domain }}"
lights_area: "TODO: Turned off the lights"
lights_floor: "TODO: Turned off the lights"
fans_area: "TODO: Turned off the fans"
cover: "TODO: Closed"
light_all: "TODO: Turned off all of the lights"
fan_all: "TODO: Turned off all of the fans"
cover_device_class: "TODO: Closed the {{ slots.device_class }}"
lock: "TODO: Unlocked"
valve: "TODO: Closed"
15 changes: 15 additions & 0 deletions responses/th/HassTurnOn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
language: th
responses:
intents:
HassTurnOn:
default: "TODO: Turned on the {{ state.domain }}"
lights_area: "TODO: Turned on the lights"
lights_floor: "TODO: Turned on the lights"
light_all: "TODO: Turned on all of the lights"
fans_area: "TODO: Turned on the fans"
cover: "TODO: Opened"
cover_device_class: "TODO: Opened the {{ slots.device_class }}"
scene: "TODO: Activated"
script: "TODO: Started"
lock: "TODO: Locked"
valve: "TODO: Opened"
5 changes: 5 additions & 0 deletions responses/th/HassUnpauseTimer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassUnpauseTimer:
default: "TODO: Timer resumed"
5 changes: 5 additions & 0 deletions responses/th/HassVacuumReturnToBase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassVacuumReturnToBase:
default: "TODO: Returning"
5 changes: 5 additions & 0 deletions responses/th/HassVacuumStart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
responses:
intents:
HassVacuumStart:
default: "TODO: Started"
31 changes: 31 additions & 0 deletions sentences/th/_common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
language: th
responses:
errors:
no_intent: ขอโทษด้วย ฉันไม่เข้าใจสิ่งที่คุณต้องการ
handle_error: มีข้อผืดพลาดบางอย่างเกิดขึ้น
no_area: ขอโทษด้วย ฉันไม่รู้จักพื้นที่ {{ area }}
no_domain: ขอโทษด้วย ฉันไม่รู้จักอุปกรณ์ประเภท {{ domain }}
no_domain_in_area: ขอโทษด้วย ฉันไม่พบอุปกรณ์ประเภท {{ domain }} อยู่ในพื้นที่ {{ area }}
no_device_class: ขอโทษด้วย ฉันไม่รู้จักอุปกรณ์ชนิด {{ device_class }}
no_device_class_in_area: ขอโทษด้วย ฉันไม่พบอุปกรณ์ชนิด {{ device_class }} อยู่ในพื้นที่ {{ area }}
no_entity: ขอโทษด้วย ฉันไม่รู้จักอุปกรณ์ชื่อ {{ entity }}
no_entity_in_area: ขอโทษด้วย ฉันไม่พบอุปกรณ์ชื่อ {{ entity }} อยู่ในพื้นที่ {{ area }}
no_entity_exposed: ขอโทษด้วย ฉันไม่สามารถเข้าถึงอุปกรณ์ชื่อ {{ entity }} ได้
no_entity_in_area_exposed: ขอโทษด้วย ฉันไม่สามารถเข้าถึงอุปกรณ์ชื่อ {{ entity }} ในพื้นที่ {{ area }} ได้
no_domain_exposed: ขอโทษด้วย ฉันไม่สามารถเข้าถึงอุปกรณ์ประเภท {{ domain }} ได้
no_domain_in_area_exposed: ขอโทษด้วย ฉันไม่สามารถเข้าถึงอุปกรณ์ประเภท {{ domain }} ในพื้นที่ {{ area }} ได้
no_device_class_exposed: ขอโทษด้วย ฉันไม่สามารถเข้าถึงอุปกรณ์ชนิด {{ domain }} ได้
no_device_class_in_area_exposed: ขอโทษด้วย ฉันไม่สามารถเข้าถึงอุปกรณ์ชนิด {{ domain }} ในพื้นที่ {{ area }} ได้
duplicate_entities: ขอโทษด้วย มีหลายอุปกรณ์ที่เรียกว่า {{ entity }}
duplicate_entities_in_area: ขอโทษด้วย มีหลายอุปกรณ์ที่เรียกว่า {{ entity }} ในพื้นที่ {{ area }}

lists: {}

expansion_rules:
area: "[ใน]{area}"
color: "[สี]{color}"

skip_words:
- "ช่วย"
- "กรุณา"
- "ให้หน่อย"
8 changes: 8 additions & 0 deletions sentences/th/binary_sensor_HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: th
intents:
HassGetState:
data:
- sentences: []
slots:
domain: binary_sensor
name: all
5 changes: 5 additions & 0 deletions sentences/th/climate_HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
intents:
HassClimateGetTemperature:
data:
- sentences: []
5 changes: 5 additions & 0 deletions sentences/th/climate_HassClimateSetTemperature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: th
intents:
HassClimateSetTemperature:
data:
- sentences: []
8 changes: 8 additions & 0 deletions sentences/th/cover_HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: th
intents:
HassGetState:
data:
- sentences: []
slots:
domain: cover
name: all
8 changes: 8 additions & 0 deletions sentences/th/cover_HassSetPosition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: th
intents:
HassSetPosition:
data:
- sentences: []
slots:
domain: cover
name: all
8 changes: 8 additions & 0 deletions sentences/th/cover_HassTurnOff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: th
intents:
HassTurnOff:
data:
- sentences: []
slots:
domain: cover
name: all
8 changes: 8 additions & 0 deletions sentences/th/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: th
intents:
HassTurnOn:
data:
- sentences: []
slots:
domain: cover
name: all
Loading

0 comments on commit 8a33a02

Please sign in to comment.