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] Current date and time #2313

Merged
merged 2 commits into from
Jul 12, 2024
Merged
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
21 changes: 21 additions & 0 deletions responses/pt-br/HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: pt-br
responses:
intents:
HassGetCurrentDate:
default: >
{% set months = {
1: 'janeiro',
2: 'fevereiro',
3: 'março',
4: 'abril',
5: 'maio',
6: 'junho',
7: 'julho',
8: 'agosto',
9: 'setembro',
10: 'outubro',
11: 'novembro',
12: 'dezembro',
} %}
{% set weekday = [ 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado', 'domingo' ] %}
{{ weekday[slots.date.weekday()] }}, {{slots.date.day}} de {{ months[slots.date.month] }} de {{ slots.date.year }}
16 changes: 16 additions & 0 deletions responses/pt-br/HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: pt-br
responses:
intents:
HassGetCurrentTime:
default: >
{% set minute_str = '{0:02d}'.format(slots.time.minute) %}

{% if slots.time.hour < 6 %}
{{ slots.time.hour }}:{{ minute_str }} da madrugada
{% elif slots.time.hour < 12 %}
{{ slots.time.hour }}:{{ minute_str }} da manhã
{% elif slots.time.hour < 18 %}
{{ slots.time.hour }}:{{ minute_str }} da tarde
{% else %}
{{ slots.time.hour }}:{{ minute_str }} da noite
{% endif %}
7 changes: 7 additions & 0 deletions sentences/pt-br/homeassistant_HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: pt-br
intents:
HassGetCurrentDate:
data:
- sentences:
- "que (dia|data) é hoje"
- "data de hoje"
6 changes: 6 additions & 0 deletions sentences/pt-br/homeassistant_HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: pt-br
intents:
HassGetCurrentTime:
data:
- sentences:
- "que horas são [agora]"
8 changes: 8 additions & 0 deletions tests/pt-br/homeassistant_HassGetCurrentDate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: pt-br
tests:
- sentences:
- "que dia é hoje"
- "data de hoje"
intent:
name: HassGetCurrentDate
response: terça-feira, 17 de setembro de 2013
7 changes: 7 additions & 0 deletions tests/pt-br/homeassistant_HassGetCurrentTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: pt-br
tests:
- sentences:
- "que horas são"
intent:
name: HassGetCurrentTime
response: 1:02 da madrugada