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

[PT-BR] New sentences and some non-translated are now translated #1798

Open
wants to merge 6 commits into
base: untranslated-state
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion responses/pt-br/HassClimateGetTemperature.yaml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add | abs to the if verification to cover for "-1 grau"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I don't think it's necessary here. Can you elaborate a little more why you think we should use abs here? Tks!

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ language: pt-br
responses:
intents:
HassClimateGetTemperature:
default: "{{ state.state }} degrees"
default: >
{% set temperature = state_attr(state.entity_id, 'current_temperature') %}
{% if temperature == 1: %}
{{ temperature }} grau
{% else: %}
{{ temperature }} graus
{% endif %}
2 changes: 1 addition & 1 deletion responses/pt-br/HassClimateSetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: pt-br
responses:
intents:
HassClimateSetTemperature:
default: Temperature set to {{ slots.temperature }} degrees
default: Temperatura definida
124 changes: 123 additions & 1 deletion responses/pt-br/HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,126 @@
language: pt-br
responses:
intents:
HassGetState: {}
HassGetState:
# the number of names returned is limited to 4, in case there are more, the first 3 names and the remaining count is returned
# with 4 names or less, the names are joined with a comma ", " and the last name is joined with " and "
one: |
{{ state.state_with_unit }}

one_yesno: |
{% if query.matched %}
Sim
{% else %}
Não, {{ state.state_with_unit }}
{% endif %}

someone_yesno: |
{% if query.matched %}
Sim
{% else %}
Não,
{% if state.attributes.get("untranslated_state") == "not_home" %}
{{ state.state }}
{% else %}
em {{ state.state }}
{% endif %}
{% endif %}

everybody: |
{% if not query.unmatched: %}
Sim
{% else %}
{% set no_match = query.unmatched | map(attribute="name") | sort | list %}
{% if no_match | length > 4 %}
Não, {{ no_match[:3] | join(", ") }} e {{ (no_match | length - 3) }} mas não estão
{% if state.attributes.get("untranslated_state") == "not_home" %}
{{ state.state }}
{% else %}
em {{ state.state }}
{% endif %}
{%- else -%}
Não,
{% for name in no_match -%}
{% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} e {% endif -%}
{{ name }}
{%- endfor %} {% if no_match | length > 1 %}estão{% else %}esta{% endif %} não
{% if state.attributes.get("untranslated_state") == "not_home" %}
{{ state.state }}
{% else %}
em {{ state.state }}
{% endif %}
{% endif %}
{% endif %}

any: |
{% if query.matched %}
{% set match = query.matched | map(attribute="name") | sort | list %}
{% if match | length > 4 %}
Sim, {{ match[:3] | join(", ") }} e {{ (match | length - 3) }} mais
{%- else -%}
Sim,
{% for name in match -%}
{% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} e {% endif -%}
{{ name }}
{%- endfor -%}
{% endif %}
{% else %}
Não
{% endif %}

all: |
{% if not query.unmatched: %}
Sim
{% else %}
{% set no_match = query.unmatched | map(attribute="name") | sort | list %}
{% if no_match | length > 4 %}
Não, {{ no_match[:3] | join(", ") }} e {{ (no_match | length - 3) }} mas não
{%- else -%}
Não,
{% for name in no_match -%}
{% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} e {% endif -%}
{{ name }}
{%- endfor %} não
{% endif %}
{% endif %}

which: |
{% if not query.matched %}
(Nenhuma|Nenhum)
{% else: %}
{% set match = query.matched | map(attribute="name") | sort | list %}
{% if match | length > 4 %}
{{ match[:3] | join(", ") }} e {{ (match | length - 3) }} mas
{% else %}
{%- for name in match -%}
{% if not loop.first and not loop.last %}, {% elif loop.last and not loop.first %} e {% endif -%}
{{ name }}
{%- endfor -%}
{% endif %}
{% endif %}

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

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

where: |
{{ slots.name | capitalize }} esta
{% if state.attributes.get("untranslated_state") == "not_home" %}
{{ state.state }}
{% else %}
em {{ state.state }}
{% endif %}
24 changes: 24 additions & 0 deletions responses/pt-br/HassGetWeather.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: pt-br
responses:
intents:
HassGetWeather:
default: >
{% set weather_condition = {
'clear': 'Céu limpo',
'clear-night': 'Céu limpo',
'cloudy': 'Céu nublado',
'exceptional': 'Condições excepcionalmente adversas',
'fog': 'Nevoeiro',
'hail': 'Granizo',
'lightning': 'Trovoada',
'lightning-rainy': 'Chuva e trovoada',
'partlycloudy': 'Céu parcialmente nublado',
'pouring': 'Chuva forte',
'rainy': 'Chuva',
'snowy': 'Neve',
'snowy-rainy': 'Chuva e neve',
'sunny': 'Sol',
'windy': 'Vento',
'windy-variant': 'Vento e céu nublado'
} %}
{{ weather_condition.get((state.attributes.get('untranslated_state') | string).lower(), "") }}, com temperatura de {{ state.attributes.get('temperature') }} {{ state.attributes.get('temperature_unit') }}
8 changes: 4 additions & 4 deletions responses/pt-br/HassLightSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: pt-br
responses:
intents:
HassLightSet:
brightness: "{{ slots.name }} brightness set to {{ slots.brightness }}"
brightness_area: Brightness in {{ slots.area }} set to {{ slots.brightness }}
color: "{{ slots.name }} color set to {{ slots.color }}"
color_area: Color in {{ slots.area }} set to {{ slots.color }}
brightness_area: O brilho de {{ slots.area }} foi definido em {{ slots.brightness }}
color_area: A cor de {{ slots.area }} foi definido em {{ slots.color }}
brightness: "Brilho definido"
color: "Cor definida"
5 changes: 5 additions & 0 deletions responses/pt-br/HassListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: pt-br
responses:
intents:
HassListAddItem:
item_added: "Adicionei {{ slots.item }}"
5 changes: 5 additions & 0 deletions responses/pt-br/HassShoppingListAddItem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: pt-br
responses:
intents:
HassShoppingListAddItem:
item_added: "Adicionei {{ slots.item }}"
13 changes: 12 additions & 1 deletion sentences/pt-br/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ lists:
out: "brown"
- in: "marrom"
out: "brown"
- in: "casa"
out: "home"
- in: "fora_de_casa"
out: "not_home"
brightness:
range:
type: "percentage"
Expand Down Expand Up @@ -115,17 +119,24 @@ lists:
out: "locked"
- in: "destrancada"
out: "unlocked"
shopping_list_item:
wildcard: true
expansion_rules:
nome: "[(o[s]|a[s])] {name}"
zona: "[(o[s]|a[s])] {area}"
adicionar: adicione|adiciona[r]
algum: "(algum|alguma|alguns|algumas)"
colocar: coloque|coloca[r]|pôr|põe
na_zona: "(n[o|a]|d[a|o]) {area}"
ligar: "(liga[r]|ligue|acende[r]|acenda|ativa[r]|ative)"
desligar: "(desliga[r]|desligue|apaga[r]|apague|desativa[r]|desative)"
abrir: "(abr[a|e]|abrir)"
fechar: "(fecha[r]|feche)"
mudar: "(pôr|põe|ponha|muda[r]|altera[r]|coloca[r]|deixa[r])"
mudar: "(pôr|põe|ponha|muda[r]|altera[r]|coloca[r]|deixa[r]|defina|definir|setar)"
brilho: "{brightness}[%| porcento]"
temperatura: "{temperature}[°| graus] [{temperature_unit}]"
esta: "(esta|está|estão|existe|existem)"
qual: "(que|qual|qual é|quais)"
skip_words:
- "porfavor"
- "por favor"
Expand Down
5 changes: 4 additions & 1 deletion sentences/pt-br/climate_HassClimateGetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ language: pt-br
intents:
HassClimateGetTemperature:
data:
- sentences: []
- sentences:
- "<qual> [a] temperatura [(do|da) {name}]"
- "<qual> a temperatura <na_zona>"
- "a que temperatura está <zona>"
5 changes: 4 additions & 1 deletion sentences/pt-br/climate_HassClimateSetTemperature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ language: pt-br
intents:
HassClimateSetTemperature:
data:
- sentences: []
- sentences:
- "<mudar> <zona> [a] <temperatura>"
- "<mudar> [a] temperatura [a] <temperatura>"
- "<mudar> [a] temperatura <na_zona> [a] <temperatura>"
33 changes: 32 additions & 1 deletion sentences/pt-br/cover_HassGetState.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@
language: pt-br
intents:
HassGetState:
data: []
data:
- sentences:
- "<nome> esta {cover_states:state} [<na_zona>]"
response: one_yesno
requires_context:
domain: cover
slots:
domain: cover

- sentences:
- "<algum> {cover_classes:device_class} [<esta>] {cover_states:state} [<na_zona>]"
response: any
slots:
domain: cover

- sentences:
- "todas [as] {cover_classes:device_class} [<na_zona>] estão {cover_states:state}"
response: all
slots:
domain: cover

- sentences:
- "(quais|qual|que) {cover_classes:device_class} (está|estão) {cover_states:state} [<na_zona>]"
response: which
slots:
domain: cover

- sentences:
- "quantas {cover_classes:device_class} estão {cover_states:state} [<na_zona>]"
response: how_many
slots:
domain: cover
17 changes: 16 additions & 1 deletion sentences/pt-br/cover_HassTurnOff.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
language: pt-br
intents:
HassTurnOff:
data: []
data:
- sentences:
- <fechar> [(o | a)] [(porta | portão) da] garagem
response: cover
slots:
device_class: garage
domain: cover
- sentences:
- <fechar> [as | os] [(cortinas | cortinados | estores | persianas)] <na_zona>
response: cover
slots:
device_class:
- blind
- curtain
- shutter
domain: cover
18 changes: 17 additions & 1 deletion sentences/pt-br/cover_HassTurnOn.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
language: pt-br
intents:
HassTurnOn:
data: []
data:
- sentences:
- <abrir> [(o|a)] [(porta|portão) da] garagem
response: cover
slots:
device_class: garage
domain: cover

- sentences:
- <abrir> [as|os] [(cortinas | cortinados | estores | persianas)] <na_zona>
response: cover
slots:
device_class:
- blind
- curtain
- shutter
domain: cover
4 changes: 3 additions & 1 deletion sentences/pt-br/fan_HassTurnOff.yaml
jmceara marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ language: pt-br
intents:
HassTurnOff:
data:
- sentences: []
- sentences:
- "<desligar> [todos] [(o[s])] (ventilador[es]) <na_zona>"
slots:
domain: fan
name: all
response: fans_area
4 changes: 3 additions & 1 deletion sentences/pt-br/fan_HassTurnOn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ language: pt-br
intents:
HassTurnOn:
data:
- sentences: []
- sentences:
- "<ligar> todos os ventiladores <na_zona>"
slots:
domain: fan
name: all
response: fans_area
32 changes: 31 additions & 1 deletion sentences/pt-br/homeassistant_HassGetState.yaml
jmceara marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
language: pt-br
intents:
HassGetState:
data: []
data:
- sentences:
- <qual> o (estado|valor) [atual] [do|da|de] <nome> [<na_zona>]
response: one
excludes_context:
domain:
- scene
- script

- sentences:
- <nome> está {on_off_states:state} [<na_zona>]
response: one_yesno
excludes_context:
domain:
- cover

- sentences:
- <algum> {on_off_domains:domain} [<esta>] {on_off_states:state} [<na_zona>]
response: any

- sentences:
- (todos|todas) [os|as] {on_off_domains:domain} estão {on_off_states:state} [<na_zona>]
response: all

- sentences:
- <qual> {on_off_domains:domain} (está|estão) {on_off_states:state} [<na_zona>]
response: which

- sentences:
- (quantos|quantas) {on_off_domains:domain} (está|estão) {on_off_states:state} [<na_zona>]
response: how_many
9 changes: 9 additions & 0 deletions sentences/pt-br/homeassistant_HassNevermind.yaml
jmceara marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: pt-br
intents:
HassNevermind:
data:
- sentences:
- "esquece"
- "deixa [(pra|para)] lá"
- "cancela[r]"
- "nada [não]"
Loading