From f106ad1a8efc3e39c1e818873e53c53aac963faa Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 2 Feb 2015 11:53:03 +0100 Subject: first i18n (WIP) --- client/modules/Joke.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'client/modules/Joke.py') diff --git a/client/modules/Joke.py b/client/modules/Joke.py index a260e5a..72a7b8b 100644 --- a/client/modules/Joke.py +++ b/client/modules/Joke.py @@ -3,7 +3,7 @@ import random import re from client import jasperpath -WORDS = ["JOKE", "KNOCK KNOCK"] +WORDS = [_("JOKE"), _("KNOCK KNOCK")] def getRandomJoke(filename=jasperpath.data('text', 'JOKES.txt')): @@ -43,7 +43,7 @@ def handle(text, mic, profile): """ joke = getRandomJoke() - mic.say("Knock knock") + mic.say(_("Knock knock")) def firstLine(text): mic.say(joke[0]) @@ -63,4 +63,4 @@ def isValid(text): Arguments: text -- user-input, typically transcribed speech """ - return bool(re.search(r'\bjoke\b', text, re.IGNORECASE)) + return bool(re.search(r"\b" + _("joke") + r"\b", text, re.IGNORECASE)) -- cgit v1.3.1