Skip to content
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
18 changes: 17 additions & 1 deletion i18n/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def can_handle(self, handler_input):
def handle(self, handler_input):
_ = handler_input.attributes_manager.request_attributes["_"]
slots = handler_input.request_envelope.request.intent.slots
locale = handler_input.request_envelope.request.locale

# extract slot values
year = slots["year"].value
Expand All @@ -163,10 +164,25 @@ def handle(self, handler_input):
handler_input.attributes_manager.persistent_attributes = session_attr
handler_input.attributes_manager.save_persistent_attributes()

speech = _(data.REGISTER_BIRTHDAY_MSG).format(month, day, year)
date = self.formatDate(year, month, day, locale)

speech = _(data.REGISTER_BIRTHDAY_MSG).format(date[0], date[1], date[2])
handler_input.response_builder.speak(speech)
return handler_input.response_builder.response

# function to ensure that the date format corresponds with the locale that is triggering thee skill
def formatDate(self, year, month, day, locale):
if locale == 'en-US':
date = [month, day, year]
elif locale == 'jp-JP':
date = [year, month, day]
else:
date = [day, month, year]

return date




class HelpIntentHandler(AbstractRequestHandler):
"""
Expand Down
Binary file added i18n/locales/de-DE/LC_MESSAGES/data.mo
Binary file not shown.
70 changes: 70 additions & 0 deletions i18n/locales/de-DE/LC_MESSAGES/data.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2019-10-02 17:11-0400\n"
"PO-Revision-Date: 2019-10-02 17:19-0400\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: de_DE\n"

#: alexa\data.py:3
msgid "Hello! Welcome to Cake walk. What is your birthday?"
msgstr "Hallo! Herzlich willkommen zu Herzlichen Glückwunsch. Wann hast du Geburtstag?"

#: alexa\data.py:4
msgid "I was born Nov. 6th, 2014. When were you born?"
msgstr "Ich bin am 6. November 2014 geboren. Wann bist du geboren?"

#: alexa\data.py:5
msgid "Welcome back. It looks like there is {} day until your {}th birthday."
msgstr "Willkommen zurück. Es sieht so aus, als ob noch {} Tag bis zu Deinem {}. Geburtstag verbleibt."

#: alexa\data.py:7
msgid "Welcome back. It looks like there are {} days until your {}th birthday"
msgstr "Willkommen zurück. Es sieht so aus, als ob noch {} Tage zu Deinem {}. Geburtstag verbleiben."

#: alexa\data.py:9
msgid "Happy {}th birthday!"
msgstr "Alles Gute zum {}. Geburtstag!"

#: alexa\data.py:10
msgid "Thanks, I'll remember that you were born {} {} {}"
msgstr "Danke, ich werde mir merken, dass du am {} {} {} geboren wurdest."

#: alexa\data.py:11
msgid ""
"You can tell me your date of birth and I'll take note. You can also just "
"say, 'register my birthday' and I will guide you. Which one would you like "
"to try?"
msgstr ""
"Du kannst mir sagen, wann du Geburtstag hast und ich werde es mir merken. "
"Du kannst auch einfach 'merke dir meinen Geburtstag' sagen und ich werde "
"dir weiterhelfen. Was würdest du gerne probieren?"

#: alexa\data.py:12
msgid "Goodbye!"
msgstr "Tschüss!"

#: alexa\data.py:13
msgid "Sorry, I couldn't understand what you said. Can you reformulate?"
msgstr "Sorry, ich konnte nicht verstehen was du gesagt hast. Kannst du das bitte umformulieren?"

#: alexa\data.py:15
msgid ""
"I can't determine your timezone. Please check your device settings and make "
"sure a timezone was selected. After that please reopen the skill and try "
"again!"
msgstr ""
"Ich kann deine Zeitzone nicht bestimmen. Bitte überprüfe deine Geräteoptionen "
"und stelle sicher, dass eine Zeitzone ausgeewählt ist. Öffne danach den Skill "
"wieder und probiere es erneut!"
Binary file added i18n/locales/en-AU/LC_MESSAGES/data.mo
Binary file not shown.
64 changes: 64 additions & 0 deletions i18n/locales/en-AU/LC_MESSAGES/data.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2019-10-02 17:11-0400\n"
"PO-Revision-Date: 2019-10-02 17:19-0400\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_AU\n"

#: alexa\data.py:3
msgid "Hello! Welcome to Cake walk. What is your birthday?"
msgstr ""

#: alexa\data.py:4
msgid "I was born Nov. 6th, 2014. When were you born?"
msgstr ""

#: alexa\data.py:5
msgid "Welcome back. It looks like there is {} day until your {}th birthday."
msgstr ""

#: alexa\data.py:7
msgid "Welcome back. It looks like there are {} days until your {}th birthday"
msgstr ""

#: alexa\data.py:9
msgid "Happy {}th birthday!"
msgstr ""

#: alexa\data.py:10
msgid "Thanks, I'll remember that you were born {} {} {}"
msgstr ""

#: alexa\data.py:11
msgid ""
"You can tell me your date of birth and I'll take note. You can also just "
"say, 'register my birthday' and I will guide you. Which one would you like "
"to try?"
msgstr ""

#: alexa\data.py:12
msgid "Goodbye!"
msgstr ""

#: alexa\data.py:13
msgid "Sorry, I couldn't understand what you said. Can you reformulate?"
msgstr ""

#: alexa\data.py:15
msgid ""
"I can't determine your timezone. Please check your device settings and make "
"sure a timezone was selected. After that please reopen the skill and try "
"again!"
msgstr ""
Binary file added i18n/locales/en-CA/LC_MESSAGES/data.mo
Binary file not shown.
64 changes: 64 additions & 0 deletions i18n/locales/en-CA/LC_MESSAGES/data.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2019-10-02 17:11-0400\n"
"PO-Revision-Date: 2019-10-02 17:19-0400\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_CA\n"

#: alexa\data.py:3
msgid "Hello! Welcome to Cake walk. What is your birthday?"
msgstr ""

#: alexa\data.py:4
msgid "I was born Nov. 6th, 2014. When were you born?"
msgstr ""

#: alexa\data.py:5
msgid "Welcome back. It looks like there is {} day until your {}th birthday."
msgstr ""

#: alexa\data.py:7
msgid "Welcome back. It looks like there are {} days until your {}th birthday"
msgstr ""

#: alexa\data.py:9
msgid "Happy {}th birthday!"
msgstr ""

#: alexa\data.py:10
msgid "Thanks, I'll remember that you were born {} {} {}"
msgstr ""

#: alexa\data.py:11
msgid ""
"You can tell me your date of birth and I'll take note. You can also just "
"say, 'register my birthday' and I will guide you. Which one would you like "
"to try?"
msgstr ""

#: alexa\data.py:12
msgid "Goodbye!"
msgstr ""

#: alexa\data.py:13
msgid "Sorry, I couldn't understand what you said. Can you reformulate?"
msgstr ""

#: alexa\data.py:15
msgid ""
"I can't determine your timezone. Please check your device settings and make "
"sure a timezone was selected. After that please reopen the skill and try "
"again!"
msgstr ""
Binary file added i18n/locales/en-GB/LC_MESSAGES/data.mo
Binary file not shown.
64 changes: 64 additions & 0 deletions i18n/locales/en-GB/LC_MESSAGES/data.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2019-10-02 17:11-0400\n"
"PO-Revision-Date: 2019-10-02 17:19-0400\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_GB\n"

#: alexa\data.py:3
msgid "Hello! Welcome to Cake walk. What is your birthday?"
msgstr ""

#: alexa\data.py:4
msgid "I was born Nov. 6th, 2014. When were you born?"
msgstr ""

#: alexa\data.py:5
msgid "Welcome back. It looks like there is {} day until your {}th birthday."
msgstr ""

#: alexa\data.py:7
msgid "Welcome back. It looks like there are {} days until your {}th birthday"
msgstr ""

#: alexa\data.py:9
msgid "Happy {}th birthday!"
msgstr ""

#: alexa\data.py:10
msgid "Thanks, I'll remember that you were born {} {} {}"
msgstr ""

#: alexa\data.py:11
msgid ""
"You can tell me your date of birth and I'll take note. You can also just "
"say, 'register my birthday' and I will guide you. Which one would you like "
"to try?"
msgstr ""

#: alexa\data.py:12
msgid "Goodbye!"
msgstr ""

#: alexa\data.py:13
msgid "Sorry, I couldn't understand what you said. Can you reformulate?"
msgstr ""

#: alexa\data.py:15
msgid ""
"I can't determine your timezone. Please check your device settings and make "
"sure a timezone was selected. After that please reopen the skill and try "
"again!"
msgstr ""
Binary file added i18n/locales/en-IN/LC_MESSAGES/data.mo
Binary file not shown.
64 changes: 64 additions & 0 deletions i18n/locales/en-IN/LC_MESSAGES/data.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2019-10-02 17:11-0400\n"
"PO-Revision-Date: 2019-10-02 17:19-0400\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 2.2.4\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_IN\n"

#: alexa\data.py:3
msgid "Hello! Welcome to Cake walk. What is your birthday?"
msgstr ""

#: alexa\data.py:4
msgid "I was born Nov. 6th, 2014. When were you born?"
msgstr ""

#: alexa\data.py:5
msgid "Welcome back. It looks like there is {} day until your {}th birthday."
msgstr ""

#: alexa\data.py:7
msgid "Welcome back. It looks like there are {} days until your {}th birthday"
msgstr ""

#: alexa\data.py:9
msgid "Happy {}th birthday!"
msgstr ""

#: alexa\data.py:10
msgid "Thanks, I'll remember that you were born {} {} {}"
msgstr ""

#: alexa\data.py:11
msgid ""
"You can tell me your date of birth and I'll take note. You can also just "
"say, 'register my birthday' and I will guide you. Which one would you like "
"to try?"
msgstr ""

#: alexa\data.py:12
msgid "Goodbye!"
msgstr ""

#: alexa\data.py:13
msgid "Sorry, I couldn't understand what you said. Can you reformulate?"
msgstr ""

#: alexa\data.py:15
msgid ""
"I can't determine your timezone. Please check your device settings and make "
"sure a timezone was selected. After that please reopen the skill and try "
"again!"
msgstr ""
Binary file added i18n/locales/es-ES/LC_MESSAGES/data.mo
Binary file not shown.
Loading