diff options
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)) |
