diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 13:23:06 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 13:23:06 +0100 |
| commit | cd6454ea6e9e0999720d053a857d37513cc8ef7e (patch) | |
| tree | 6a1e9f078317b7fe91bbe6345b18029de46eecc5 | |
| parent | fe02dbcfb22bef26c0490d826ed29b49551a3cdf (diff) | |
| download | jasper-client-cd6454ea6e9e0999720d053a857d37513cc8ef7e.tar.gz jasper-client-cd6454ea6e9e0999720d053a857d37513cc8ef7e.zip | |
add more translatable strings
| -rw-r--r-- | client/brain.py | 4 | ||||
| -rw-r--r-- | client/conversation.py | 2 | ||||
| -rw-r--r-- | client/modules/Life.py | 8 | ||||
| -rw-r--r-- | languages/de_DE/LC_MESSAGES/messages.po | 46 |
4 files changed, 46 insertions, 14 deletions
diff --git a/client/brain.py b/client/brain.py index 593ca39..8691c25 100644 --- a/client/brain.py +++ b/client/brain.py @@ -74,8 +74,8 @@ class Brain(object): except: self._logger.error('Failed to execute module', exc_info=True) - self.mic.say("I'm sorry. I had some trouble with " + - "that operation. Please try again later.") + self.mic.say(_("I'm sorry. I had some trouble with " + + "that operation. Please try again later.")) else: self._logger.debug("Handling of phrase '%s' by " + "module '%s' completed", text, diff --git a/client/conversation.py b/client/conversation.py index 6b2fab1..34b0479 100644 --- a/client/conversation.py +++ b/client/conversation.py @@ -46,4 +46,4 @@ class Conversation(object): if input: self.brain.query(input) else: - self.mic.say("Pardon?") + self.mic.say(_("Pardon?")) diff --git a/client/modules/Life.py b/client/modules/Life.py index 658e5cf..f59137a 100644 --- a/client/modules/Life.py +++ b/client/modules/Life.py @@ -2,7 +2,7 @@ import random import re -WORDS = ["MEANING", "OF", "LIFE"] +WORDS = [_("MEANING"), _("OF"), _("LIFE")] def handle(text, mic, profile): @@ -16,8 +16,8 @@ def handle(text, mic, profile): profile -- contains information related to the user (e.g., phone number) """ - messages = ["It's 42, you idiot.", - "It's 42. How many times do I have to tell you?"] + messages = [_("It's 42, you idiot."), + _("It's 42. How many times do I have to tell you?")] message = random.choice(messages) @@ -31,4 +31,4 @@ def isValid(text): Arguments: text -- user-input, typically transcribed speech """ - return bool(re.search(r'\bmeaning of life\b', text, re.IGNORECASE)) + return bool(re.search(r'\b', _('meaning of life'), r'\b', text, re.IGNORECASE)) diff --git a/languages/de_DE/LC_MESSAGES/messages.po b/languages/de_DE/LC_MESSAGES/messages.po index 1c84ca6..d770cc9 100644 --- a/languages/de_DE/LC_MESSAGES/messages.po +++ b/languages/de_DE/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Jasper VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2015-02-02 11:43+0100\n" +"POT-Creation-Date: 2015-02-02 13:21+0100\n" "PO-Revision-Date: 2015-02-02 10:50+0100\n" "Last-Translator: MakeMeASandwich\n" "Language-Team: de_DE <LL@li.org>\n" @@ -18,31 +18,63 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 1.3\n" -#: jasper-client/jasper.py:112 +#: jasper-client/jasper.py:119 #, python-format msgid "How can I be of service, %s?" msgstr "Wie kann ich helfen, %s?" -#: jasper-client/jasper.py:115 +#: jasper-client/jasper.py:122 msgid "How can I be of service?" msgstr "Wie kann ich helfen?" -#: jasper-client/client/modules/Joke.py:7 +#: jasper-client/client/brain.py:77 +msgid "I'm sorry. I had some trouble with that operation. Please try again later." +msgstr "" + +#: jasper-client/client/conversation.py:49 +msgid "Pardon?" +msgstr "" + +#: jasper-client/client/modules/Joke.py:6 msgid "JOKE" msgstr "WITZ" -#: jasper-client/client/modules/Joke.py:7 +#: jasper-client/client/modules/Joke.py:6 msgid "KNOCK KNOCK" msgstr "KLOPF KLOPF" -#: jasper-client/client/modules/Joke.py:47 +#: jasper-client/client/modules/Joke.py:46 msgid "Knock knock" msgstr "Klopf Klopf" -#: jasper-client/client/modules/Joke.py:67 +#: jasper-client/client/modules/Joke.py:66 msgid "joke" msgstr "witz" +#: jasper-client/client/modules/Life.py:5 +msgid "MEANING" +msgstr "" + +#: jasper-client/client/modules/Life.py:5 +msgid "OF" +msgstr "" + +#: jasper-client/client/modules/Life.py:5 +msgid "LIFE" +msgstr "" + +#: jasper-client/client/modules/Life.py:19 +msgid "It's 42, you idiot." +msgstr "" + +#: jasper-client/client/modules/Life.py:20 +msgid "It's 42. How many times do I have to tell you?" +msgstr "" + +#: jasper-client/client/modules/Life.py:34 +msgid "meaning of life" +msgstr "" + #: jasper-client/client/modules/Time.py:6 msgid "TIME" msgstr "ZEIT" |
