diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 11:53:03 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 11:53:03 +0100 |
| commit | f106ad1a8efc3e39c1e818873e53c53aac963faa (patch) | |
| tree | 25a9f0ae4080705c71bd30ce8753782086d40e08 /client/modules/Time.py | |
| parent | 7786b9e586f504f20ec28be9213aff18abcc81a2 (diff) | |
| download | jasper-client-f106ad1a8efc3e39c1e818873e53c53aac963faa.tar.gz jasper-client-f106ad1a8efc3e39c1e818873e53c53aac963faa.zip | |
first i18n (WIP)
Diffstat (limited to 'client/modules/Time.py')
| -rw-r--r-- | client/modules/Time.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/client/modules/Time.py b/client/modules/Time.py index 4726839..0d57265 100644 --- a/client/modules/Time.py +++ b/client/modules/Time.py @@ -2,9 +2,8 @@ import datetime import re from client.app_utils import getTimezone -from semantic.dates import DateService -WORDS = ["TIME"] +WORDS = [_("TIME")] def handle(text, mic, profile): @@ -20,9 +19,7 @@ def handle(text, mic, profile): tz = getTimezone(profile) now = datetime.datetime.now(tz=tz) - service = DateService() - response = service.convertTime(now) - mic.say("It is %s right now." % response) + mic.say(_("It is %s right now.") % now.strftime(_("%I %M %p"))) def isValid(text): @@ -32,4 +29,4 @@ def isValid(text): Arguments: text -- user-input, typically transcribed speech """ - return bool(re.search(r'\btime\b', text, re.IGNORECASE)) + return bool(re.search(r"\b" + _("time") + r"\b", text, re.IGNORECASE)) |
