From a53294dbc51f1a34d2b4aac95b9dc499ca15fabc Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 20 Oct 2017 23:49:06 +0700 Subject: [PATCH 01/14] Added language class --- Stephanie/language.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Stephanie/language.py diff --git a/Stephanie/language.py b/Stephanie/language.py new file mode 100644 index 0000000..3f0908d --- /dev/null +++ b/Stephanie/language.py @@ -0,0 +1,27 @@ +from Stephanie.configurer import config + + +class Language: + + _languages = { + "en": "English", + "it": "Italiano", + } + + _default = "en" + + def __init__(self): + config_language = config.config.get("SYSTEM", "language") + + if(config_language in Language._languages): + self.system_language = config_language + else: + self.system_language = Language._default + + def get_code(self): + return self.system_language + + def get_name(self): + return Language._languages[self.system_language] + +lang = Language() From 40b1910427b39929bd0f280c978a6a307f02b9fb Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 20 Oct 2017 23:50:40 +0700 Subject: [PATCH 02/14] Created translation files en and it --- Stephanie/locales/en/LC_MESSAGES/messages.po | 118 +++++++++++++++++++ Stephanie/locales/it/LC_MESSAGES/messages.po | 118 +++++++++++++++++++ 2 files changed, 236 insertions(+) create mode 100644 Stephanie/locales/en/LC_MESSAGES/messages.po create mode 100644 Stephanie/locales/it/LC_MESSAGES/messages.po diff --git a/Stephanie/locales/en/LC_MESSAGES/messages.po b/Stephanie/locales/en/LC_MESSAGES/messages.po new file mode 100644 index 0000000..11df53b --- /dev/null +++ b/Stephanie/locales/en/LC_MESSAGES/messages.po @@ -0,0 +1,118 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#: src/link/to/my/src:67 +msgid "" +msgstr "" +"Project-Id-Version: xxx\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-06 12:31-0500\n" +"PO-Revision-Date: 2011-05-27 22:37+0100\n" +"Last-Translator: My NAME\n" +"Language-Team: TEAM \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Stephanie/boot.py:25 +msgid "Stephanie is on and loading, wait for the beep sound to give your command." +msgstr "English Version: Stephanie is on and loading, wait for the beep sound to give your command." + +#: Stephanie/AudioManager/audio_recognizer.py:16 +msgid "sphinx_audio_understood" +msgstr "English Version: sphinx_audio_understood" + +#: Stephanie/AudioManager/audio_recognizer.py:19 +msgid "Sphinx could not understand audio" +msgstr "English Version: Sphinx could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:22 +msgid "Sphinx error; {0}" +msgstr "English Version: Sphinx error; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:31 +msgid "Google Speech Recognition thinks you said " +msgstr "English Version: Google Speech Recognition thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:34 +msgid "Google Recognition couldn't understand your audio with enough confidence." +msgstr "English Version: Google Recognition couldn't understand your audio with enough confidence." + +#: Stephanie/AudioManager/audio_recognizer.py:36 +msgid "Google Speech Recognition could not understand audio" +msgstr "English Version: Google Speech Recognition could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:39 +msgid "Could not request results from Google Speech Recognition service; {0}" +msgstr "English Version: Could not request results from Google Speech Recognition service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:47 +#: Stephanie/AudioManager/audio_recognizer.py:67 +#: Stephanie/AudioManager/audio_recognizer.py:86 +#: Stephanie/AudioManager/audio_recognizer.py:107 +#: Stephanie/AudioManager/audio_recognizer.py:129 +msgid "Api key not found in the config.ini file." +msgstr "English Version: Api key not found in the config.ini file." + +#: Stephanie/AudioManager/audio_recognizer.py:52 +msgid "Google Cloud Speech thinks you said " +msgstr "English Version: Google Cloud Speech thinks you said" + +#: Stephanie/AudioManager/audio_recognizer.py:55 +msgid "Google Cloud Speech could not understand audio" +msgstr "English Version: Google Cloud Speech could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:58 +msgid "Could not request results from Google Cloud Speech service; {0}" +msgstr "English Version: Could not request results from Google Cloud Speech service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:71 +msgid "Wit.ai thinks you said " +msgstr "English Version: Wit.ai thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:74 +msgid "Wit.ai could not understand audio" +msgstr "English Version: Wit.ai could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:77 +msgid "Could not request results from Wit.ai service; {0}" +msgstr "English Version: Could not request results from Wit.ai service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:90 +msgid "Microsoft Bing Voice Recognition thinks you said " +msgstr "English Version: Microsoft Bing Voice Recognition thinks you said" + +#: Stephanie/AudioManager/audio_recognizer.py:93 +msgid "Microsoft Bing Voice Recognition could not understand audio" +msgstr "English Version: Microsoft Bing Voice Recognition could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:96 +msgid "Could not request results from Microsoft Bing Voice Recognition service; {0}" +msgstr "English Version: Could not request results from Microsoft Bing Voice Recognition service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:112 +msgid "Houndify thinks you said " +msgstr "English Version: Houndify thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:115 +msgid "Houndify could not understand audio" +msgstr "English Version: Houndify could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:118 +msgid "Could not request results from Houndify service; {0}" +msgstr "English Version: Could not request results from Houndify service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:134 +msgid "IBM Speech to Text thinks you said " +msgstr "English Version: IBM Speech to Text thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:137 +msgid "IBM Speech to Text could not understand audio" +msgstr "English Version: IBM Speech to Text could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:140 +msgid "Could not request results from IBM Speech to Text service; {0}" +msgstr "English Version: Could not request results from IBM Speech to Text service; {0}" + diff --git a/Stephanie/locales/it/LC_MESSAGES/messages.po b/Stephanie/locales/it/LC_MESSAGES/messages.po new file mode 100644 index 0000000..3d1fc16 --- /dev/null +++ b/Stephanie/locales/it/LC_MESSAGES/messages.po @@ -0,0 +1,118 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#: src/link/to/my/src:67 +msgid "" +msgstr "" +"Project-Id-Version: xxx\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-07-06 12:31-0500\n" +"PO-Revision-Date: 2011-05-27 22:37+0100\n" +"Last-Translator: My NAME\n" +"Language-Team: TEAM \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: Stephanie/boot.py:25 +msgid "Stephanie is on and loading, wait for the beep sound to give your command." +msgstr "Italian Version: Stephanie is on and loading, wait for the beep sound to give your command." + +#: Stephanie/AudioManager/audio_recognizer.py:16 +msgid "sphinx_audio_understood" +msgstr "Italian Version: sphinx_audio_understood" + +#: Stephanie/AudioManager/audio_recognizer.py:19 +msgid "Sphinx could not understand audio" +msgstr "Italian Version: Sphinx could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:22 +msgid "Sphinx error; {0}" +msgstr "Italian Version: Sphinx error; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:31 +msgid "Google Speech Recognition thinks you said " +msgstr "Italian Version: Google Speech Recognition thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:34 +msgid "Google Recognition couldn't understand your audio with enough confidence." +msgstr "Italian Version: Google Recognition couldn't understand your audio with enough confidence." + +#: Stephanie/AudioManager/audio_recognizer.py:36 +msgid "Google Speech Recognition could not understand audio" +msgstr "Italian Version: Google Speech Recognition could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:39 +msgid "Could not request results from Google Speech Recognition service; {0}" +msgstr "Italian Version: Could not request results from Google Speech Recognition service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:47 +#: Stephanie/AudioManager/audio_recognizer.py:67 +#: Stephanie/AudioManager/audio_recognizer.py:86 +#: Stephanie/AudioManager/audio_recognizer.py:107 +#: Stephanie/AudioManager/audio_recognizer.py:129 +msgid "Api key not found in the config.ini file." +msgstr "Italian Version: Api key not found in the config.ini file." + +#: Stephanie/AudioManager/audio_recognizer.py:52 +msgid "Google Cloud Speech thinks you said " +msgstr "Italian Version: Google Cloud Speech thinks you said" + +#: Stephanie/AudioManager/audio_recognizer.py:55 +msgid "Google Cloud Speech could not understand audio" +msgstr "Italian Version: Google Cloud Speech could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:58 +msgid "Could not request results from Google Cloud Speech service; {0}" +msgstr "Italian Version: Could not request results from Google Cloud Speech service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:71 +msgid "Wit.ai thinks you said " +msgstr "Italian Version: Wit.ai thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:74 +msgid "Wit.ai could not understand audio" +msgstr "Italian Version: Wit.ai could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:77 +msgid "Could not request results from Wit.ai service; {0}" +msgstr "Italian Version: Could not request results from Wit.ai service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:90 +msgid "Microsoft Bing Voice Recognition thinks you said " +msgstr "Italian Version: Microsoft Bing Voice Recognition thinks you said" + +#: Stephanie/AudioManager/audio_recognizer.py:93 +msgid "Microsoft Bing Voice Recognition could not understand audio" +msgstr "Italian Version: Microsoft Bing Voice Recognition could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:96 +msgid "Could not request results from Microsoft Bing Voice Recognition service; {0}" +msgstr "Italian Version: Could not request results from Microsoft Bing Voice Recognition service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:112 +msgid "Houndify thinks you said " +msgstr "Italian Version: Houndify thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:115 +msgid "Houndify could not understand audio" +msgstr "Italian Version: Houndify could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:118 +msgid "Could not request results from Houndify service; {0}" +msgstr "Italian Version: Could not request results from Houndify service; {0}" + +#: Stephanie/AudioManager/audio_recognizer.py:134 +msgid "IBM Speech to Text thinks you said " +msgstr "Italian Version: IBM Speech to Text thinks you said " + +#: Stephanie/AudioManager/audio_recognizer.py:137 +msgid "IBM Speech to Text could not understand audio" +msgstr "Italian Version: IBM Speech to Text could not understand audio" + +#: Stephanie/AudioManager/audio_recognizer.py:140 +msgid "Could not request results from IBM Speech to Text service; {0}" +msgstr "Italian Version: Could not request results from IBM Speech to Text service; {0}" + From 11f64961cc4966c776e789237c493f1a583de255 Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 20 Oct 2017 23:52:22 +0700 Subject: [PATCH 03/14] Imported gettext to handle translations --- Stephanie/AudioManager/audio_recognizer.py | 54 +++++++++++----------- Stephanie/boot.py | 7 ++- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/Stephanie/AudioManager/audio_recognizer.py b/Stephanie/AudioManager/audio_recognizer.py index 8d5c721..9368a80 100644 --- a/Stephanie/AudioManager/audio_recognizer.py +++ b/Stephanie/AudioManager/audio_recognizer.py @@ -13,13 +13,13 @@ def recognize_from_sphinx(self, audio): # recognize speech using Sphinx try: text = self.r.recognize_sphinx(audio) - print("Sphinx thinks you said " + text) + print(_("Sphinx thinks you said ") + text) return text except self.UnknownValueError: - print("Sphinx could not understand audio") + print(_("Sphinx could not understand audio")) return False except self.RequestError as e: - print("Sphinx error; {0}".format(e)) + print(_("Sphinx error; {0}").format(e)) return False def recognize_from_google(self, audio): @@ -28,15 +28,15 @@ def recognize_from_google(self, audio): # to use another API key, use `r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")` # instead of `r.recognize_google(audio)` text = self.r.recognize_google(audio) - print("Google Speech Recognition thinks you said " + text) + print(_("Google Speech Recognition thinks you said ") + text) return text except KeyError: - print("Google Recognition couldn't understand your audio with enough confidence.") + print(_("Google Recognition couldn't understand your audio with enough confidence.")) except self.UnknownValueError: - print("Google Speech Recognition could not understand audio") + print(_("Google Speech Recognition could not understand audio")) return False except self.RequestError as e: - print("Could not request results from Google Speech Recognition service; {0}".format(e)) + print(_("Could not request results from Google Speech Recognition service; {0}").format(e)) return False def recognize_from_google_cloud(self, audio): @@ -44,18 +44,18 @@ def recognize_from_google_cloud(self, audio): try: google_cloud_speech_credentials = self.c.config['STT_KEYS']['google_cloud_speech_api'] except KeyError: - print("Api key not found in the config.ini file.") + print(_("Api key not found in the config.ini file.")) return False try: text = self.r.recognize_google_cloud(audio, credentials_json=google_cloud_speech_credentials) - print("Google Cloud Speech thinks you said " + text) + print(_("Google Cloud Speech thinks you said ") + text) return text except self.UnknownValueError: - print("Google Cloud Speech could not understand audio") + print(_("Google Cloud Speech could not understand audio")) return False except self.RequestError as e: - print("Could not request results from Google Cloud Speech service; {0}".format(e)) + print(_("Could not request results from Google Cloud Speech service; {0}").format(e)) return False def recognize_from_wit(self, audio): @@ -64,17 +64,17 @@ def recognize_from_wit(self, audio): wit_ai_key = self.c.config['STT_KEYS'][ 'wit.ai_speech_api'] # Wit.ai keys are 32-character uppercase alphanumeric strings except KeyError: - print("Api key not found in the config.ini file.") + print(_("Api key not found in the config.ini file.")) return False try: text = self.r.recognize_wit(audio, key=wit_ai_key) - print("Wit.ai thinks you said " + text) + print(_("Wit.ai thinks you said ") + text) return text except self.UnknownValueError: - print("Wit.ai could not understand audio") + print(_("Wit.ai could not understand audio")) return False except self.RequestError as e: - print("Could not request results from Wit.ai service; {0}".format(e)) + print(_("Could not request results from Wit.ai service; {0}").format(e)) return False def recognize_from_bing(self, audio): @@ -83,17 +83,17 @@ def recognize_from_bing(self, audio): try: bing_key = self.c.config['STT_KEYS']['bing_speech_api'] except KeyError: - print("Api key not found in the config.ini file.") + print(_("Api key not found in the config.ini file.")) return False try: text = self.r.recognize_bing(audio, key=bing_key) - print("Microsoft Bing Voice Recognition thinks you said " + text) + print(_("Microsoft Bing Voice Recognition thinks you said ") + text) return text except self.UnknownValueError: - print("Microsoft Bing Voice Recognition could not understand audio") + print(_("Microsoft Bing Voice Recognition could not understand audio")) return False except self.RequestError as e: - print("Could not request results from Microsoft Bing Voice Recognition service; {0}".format(e)) + print(_("Could not request results from Microsoft Bing Voice Recognition service; {0}").format(e)) return False def recognize_from_houndify(self, audio): @@ -104,18 +104,18 @@ def recognize_from_houndify(self, audio): houndify_client_key = self.c.config['STT_KEYS'][ 'houndify_client_key'] # Houndify client keys are Base64-encoded strings except KeyError: - print("Api key not found in the config.ini file.") + print(_("Api key not found in the config.ini file.")) return False try: text = self.r.recognize_houndify(audio, client_id=houndify_client_id, client_key=houndify_client_key) - print("Houndify thinks you said " + text) + print(_("Houndify thinks you said ") + text) return text except self.UnknownValueError: - print("Houndify could not understand audio") + print(_("Houndify could not understand audio")) return False except self.RequestError as e: - print("Could not request results from Houndify service; {0}".format(e)) + print(_("Could not request results from Houndify service; {0}").format(e)) return False def recognize_from_ibm(self, audio): @@ -126,16 +126,16 @@ def recognize_from_ibm(self, audio): # IBM Speech to Text passwords are mixed-case alphanumeric strings ibm_password = self.c.config['STT_KEYS']['ibm_password'] except KeyError: - print("Api key not found in the config.ini file.") + print(_("Api key not found in the config.ini file.")) return False try: text = self.r.recognize_ibm(audio, username=ibm_username, password=ibm_password) - print("IBM Speech to Text thinks you said " + text) + print(_("IBM Speech to Text thinks you said ") + text) return text except self.UnknownValueError: - print("IBM Speech to Text could not understand audio") + print(_("IBM Speech to Text could not understand audio")) return False except self.RequestError as e: - print("Could not request results from IBM Speech to Text service; {0}".format(e)) + print(_("Could not request results from IBM Speech to Text service; {0}").format(e)) return False diff --git a/Stephanie/boot.py b/Stephanie/boot.py index 3f159cb..e149a41 100644 --- a/Stephanie/boot.py +++ b/Stephanie/boot.py @@ -1,3 +1,4 @@ +import gettext import speech_recognition as sr from Stephanie.activity import Activity from Stephanie.virtual_assistant import VirtualAssistant @@ -5,6 +6,7 @@ from Stephanie.TextManager.text_manager import TextManager from Stephanie.configurer import config from Stephanie.updater import Updater +from Stephanie.language import lang class Boot: @@ -17,7 +19,10 @@ def __init__(self): self.updater = Updater(self.speaker) def initiate(self): - print("Stephanie is on and loading, wait for the beep sound to give your command.") + translations = gettext.translation('messages', localedir='Stephanie/locales', languages=[lang.get_code()]) + translations.install() + + print(_("Stephanie is on and loading, wait for the beep sound to give your command.")) if self.c.config.getboolean("APPLICATION", "update_check"): self.updater.check_for_update() self.status = True From 11dd7c1df117f2150c53c145e480effc7bf17236 Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 20 Oct 2017 23:52:55 +0700 Subject: [PATCH 04/14] Renamed Index to index as written in documentation --- Index.py => index.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Index.py => index.py (100%) diff --git a/Index.py b/index.py similarity index 100% rename from Index.py rename to index.py From 76f33b4ad609d5ef8c445c6335f42adff7e295ec Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 20 Oct 2017 23:53:52 +0700 Subject: [PATCH 05/14] Added language to config file --- config.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.ini b/config.ini index 6541682..93290dd 100644 --- a/config.ini +++ b/config.ini @@ -19,6 +19,7 @@ wake_up_engine = False wake_up_command = Stephanie wake up greet_engine = True always_on_engine = False +language = en [STT] initial_stt_engine = google @@ -66,7 +67,7 @@ oauth_access_token = [LOGS] start_text = Give me your command! -listened_success_text = Your command is my order! +listened_success_text = Processing command... listened_error_text = I beg your pardon, could you repeat your command once again? [CORE] From 30e7785bdab96907863c3d9e31d76703e7c06446 Mon Sep 17 00:00:00 2001 From: Lily Date: Sun, 22 Oct 2017 14:57:03 +0700 Subject: [PATCH 06/14] Added speak mp3 to gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index e859fcb..e7d0dac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# generated speach file +speak.mp3 + + # Created by .ignore support plugin (hsz.mobi) ### Python template # Byte-compiled / optimized / DLL files From 86710f03692a9b5fd0df63575f983977aaa8c3bf Mon Sep 17 00:00:00 2001 From: Lily Date: Sun, 22 Oct 2017 14:58:40 +0700 Subject: [PATCH 07/14] Removed speak mp3 --- Stephanie/speeches/speak.mp3 | Bin 8064 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Stephanie/speeches/speak.mp3 diff --git a/Stephanie/speeches/speak.mp3 b/Stephanie/speeches/speak.mp3 deleted file mode 100644 index b6f5124b49bd2cc5d6ff8f08297f4110ec80c795..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8064 zcmeI$cQjnlz6bE5cQK>aAX*3^S_q%Fz!e|P_N)|xY)^E==DTYK%Z!2`t(08%W;1NiE=67R7RvS-y- zWN}ZBR5Jtz%hA<^V0kKL(@X!Ekq>2UN*KAl&?6WmuW%wywZAiBG2cb_7EyouC(r$x zSaHjMOA&tL>#Ife`zjeR-{HlFr*{k#!E2usy7$@@@YO`V_3Nzr*q}&0$3w{Oxr|ee z+#3Tn`Ij|LX{FZcCm|^Yr0}omphJx{iGOzS#ce1S? z&%~N`H;JH9>#0iSwD~YTC9OndG~la;;H)P3V(0Fs*1i>-WV{i;dc(Lf^ zDQMb@@rj^80{H;1rfbF=uRC@n03i^IzH29_$kbVOsx%}ct{2e=v&rI7${OP=7^LAP zr*|;Tw0}}DEEmd9z<1Y_FxTWOxAJFjY=5nxXx5T~8GBlV$C8|Es`2ezY>W@3?ky|> zH1LtC+G8wq+%hbj>kMQNJvy0NVSJxF(;ByEvR< zBD)$(TFl;<%s;V@AQ=NH6n5=X*mOlRq<-MrT}Isxb_>m_JNF&Vvi%IxoxM3}U~wLO zMdyoU>F;BUgnAyIrSQC>I3o#{>d=8>d}7M!kBxvc1yUQ_Iem_d*dw<~5l|e+`@^9m0~*p$X+MakyY=;1D3tW;HeHI(Do3v34`L}P1&X3ODchIo z0+-#YQnV@kaT}3_d;h4vuCfYsVsUJDniWBpAN=r6CAbQ=xvj5HsTaPfr@qek34D0fYx)lCbpS7w z*^y45niRgk+~;3%dT~QX#ND0P;Q?=GIFyxNIfH-1M&XZs-^YHeJ^CBt6H+?lUHdx7 zF?N<$9f_t}8ofw|6Y{{?LwB@>AYBgoWPyL7@1)O*XSz=p!IFh{7q700z(XB>ZXxy` z3=^P?8Xnv3Pdu^8Op1%Q7h&RO@lxcYMsu~YXk^ddd?)j0;c6+J+Shhke=u`F2FHqr|dyv~vw+2W9}z)anstF?St zC;ltezz+4|^5|SFZW9P)W4VbT#;1hl?pFcMp<9gNQiN&8a;BoU|LvIg=D4^VP07f(YI)M~~*f#BKu21A3&SdLGrng)an zx+}wNO7D&@x)>rqH(y?A8deY(ikdy?QtZeBVwH5+;gR-vc@<(Z{N?XGu#k)v!%7&R z8q5xWbypBkF4;oU-x!=&b9}p{%aZH~1e$Rd?(^R3wh$DCtPT5!L>I9)LX5 z;YeD8t4Fj6kKEA08u4L}>)o2mX0R@Hc#B{l#+QW(l^}tBbtHYkBpzNV38L`j^8+vG zR{#OID!zm;Z&ug-FE_f1Th;-ql5kSVK7*cf57{YD%g8aD|0PnrfU(Qtf}EH0mXQB4}8A1pVguuU#hLg^Qfj-lpB-zMsREoGG&mC-=Me z^zlPbF2@WQU!Oj$s|e_uMBbok>Q1Mm*Vo4nXO48k8Un#fbw1O_XV|JZHn7`;os?`A z;Ytasw@U$W#>ajsf8-t2AesW{l5BOVri~WPC%q^D~Kb zpFZr>WB6&ifV2-t&V0u$MTn-{@*c=z2kRwBqenc+5RlZ+T2LbX@f0{EFDyUc@loHn5HhV|V?cb8P{ zrxpgD|5*6EdiW?)SN!b@VNG<5cvmiu*YO@ywB{gX=a!4bbJEXe0hh(Z0R8s$1FlTk zo0CkQVJps6HYKHO5vKp`PYOzhj~zh!H{_T(a1jFkIq#g-ePZ%f^WwPdq-K^tUQw)& zEjaAM@3>6tFSr;vm_zvimlLztGx*k4)3*5Y(-SkZGn`sVv3u5*B6+ZMKHSc) z21=rJfAgn?!eToBhi^zX&ZC=5(5SVZ-VdJzDO-V}>JN@>ZtHv~8y=NXN4OA)(M7?2 z^~Z(7>T=}MPrl^R7N;mQLPs&qJoN$!z!3|FoNl zC5JnZfF+B2!*Oq5$8(Wz%Xv>!b+4pxU5_0*{+2F1FU1+g=Y#aV?g4zE$fD3P8a)S7 zKV!cBhS{Ul3_tyXA0klqq(kCB^^(QYmZ|F94|KnhGlJ=`OH)P#-s^EqOphpkP)c5t z{5Frb-YUdvb5B>zdi$doeJhSCo~aU(2gVnJtOxV}evgsPSqs^{?>4u#vQrxA>3)GZ zo!+$+xU@VGoQ%?V_wl%KUiwS9B^MfcI*!^;bz0E1Q5w@(K&TU-9cr8?Ekpi3g4jGA zAD{fN%6WB!x8wbpmKuyN2W5ly0H&jEHBAePo(JXCoa2PC?W6jopGzK0_X(C8G(SXN z&S2+u3vDdhQm{k@$+G(D3$Vx!vS#{^+h*$N`;;+Sea-RZlBwcl$NQp~=hRZ(v^rK5CEsVhCdlV@Rq(W&i1^B;7hV-g7LI zE*G-6@c#5vAzht^`Q@yuzUYwoN7Iw}*!Ht{+zA!QyJpsTsoxbihOr0xG5%vH4B7&i zv$$DjT5>PtwO&e#@v+n-?)r zN4aRh;O!5M@ZMl6IEIl8Fi40jk{0QH8p*ntPU~ZyX0PnIAUK)h6ZSL=} z-Z~AHMLJI1=nYs{Hrf){DxUQ%*%iR}&!JY?*ZweaoqBq*K=>&(oYpvpC4kfUyYg$u z9jHj$w>w;VHbf`oX>g6Bv}fNN{WFt$8W-((#bb`_=Cq#o>%Vxsr;Nh7UBWKqqga;nSzby zw=ZG2fknB+JB49Gl_%V6OJzxl`<&E9(V;}8$%mi3cI(34rPTJ1B7!SURX-KJUlOsz z_^yzp7af4(DAE>7vgLN@EDwVfUb<76z(Ca+msV@8txNUYdW|9N>-FW2YBBMS*e=Pl zMAYQ5^sxB!9tC-ly|mtluGSaC$xcEMg1DLguqyF>J#`8--s|^PvKZfwlAgU5@Edhq z5^~rOzoV-*VQTAb!h2pK=~BWj0OmF(%-CMz`|Tz6Pp67Qq0&>dHRvWKl2jAip96*h zJ72}J?dDd8>U`o!*z8ZK_%m>xwb>A5`h+ZZa$@`-Dxr-EpiMhfQ=;S%KaZE%RvD>g zTZzkd4ZZIpizPa)?|9S^jAA!lpYJ^Qv_k;#d4o3~q{WQN>5#$EyVlDcy1L_BqUA}q4FICgZpk*aJM6)nqQ z8R*`%Wd=^CUbnA@!ACy#rXFpM7s6=JCXUPilqTf%=Mw@)!=_V&(FnQnXhPR(w+R-&bqrN?gD!&Wjf zP7QY<{0h1|e(BPo04oQt#EbM?F8H4#sH;vJ?gzeo(E3-?VslNo3S5%{M<64y(smQ$ zC($~bRRO;EsVdJ@1SiEWL2dNnN$xL3-x5CiP+D>vVN%!lKkd6Z3Rx8dVQ!`oH6jpe#YEu1G&c_%R2|Jx10jRB655{Z@X%&|91LIK1--~XG{(A%D(C9eGoBbq1Qa{N}MK~MnI5L zTt)0nTMFj{t-)B{6>rwcZ>*HRJ~U0H5s3QcIxxwMStvqJjLFoCtrj#px@K9X)k_dg$9DPa-8!nI-R_mbO^u2!f^-%Zs zBq|P9X0rYmKMO)+)Cl+uCzS*<3%yCJB53cyk>}9p@Cohexe-T17sx{^C-H_|`<-k} zq07`(>7n*CW1^9VU~3DkTbLQLn%83}(S2WrMPd?pjkDH=9?TRCi~01=kWrmt{8GxG zk}{x+7)eMVcRPcPr%f>y9rqd=+f#;y)1qeGYBvV{T1N6*@DgChMz;alEvw5{C9pUsU7n2fxcm+anklJu~JJ4D|Z|I-e>gX z&o}C?U-)_~D_9t*@TQb!X>QI%ki6 zNzblkVEiU1QF_V3M~CN#St~xb@29 z+ydQg#?`488Fk-sPYx2_VfkIhI5D|Lh(AhhHh~$X5E8h?5J#qAtA=YU^ALGxn!QGKqsXoBca-*vi?Z408>tIU2XJ>W8i(z_;F!OiWdZk`)K||W* zsxwBm?MNmQFp2R?D5v*}u)1XdI>chib+-s|!#|0-#x!QqnW)EeM6>4_aG?i<6;O_k zO>DTU9jt;1kj<$6XrlD`w1X&1dlCa1WBuAcV6m(I<-z`y-p z4o%xG0`BXj(l1fR#a4O+yof_L9AzPp)&c)i1g^rZ%E!K*nHMcp0nh3>3T+kE7JVChrFUkxgka|_bzWpd z1Ih^Jzipy8~cSSwfxu z{Gyhj`lkD=y{Ufnij19Duhm>01mk~(%6%*YS|1~Avu}{)w!|AaQJxd8d-olTKOGY^ z-8;<$|C|@OZaEj}LaDb!+StTrzlAgwbq#ct770SoZW=mYC8pAbrhX&3CruJ78-zoh z`yAmkgi6#Lsht?V2@1JBA8TDe?kl`~OU@-Fc~NJ*;=lambVJ-Q{qA_8PS!TwU`VC& z%I&y1cS;=Htj!|o)$wUEUFS2;SCyt4E`>*wTTM)=`mKaE6C^L&u{hc@McdAj1&X6C zFn%}1baolgmWurSQ1X1@^PS-*v>Dr!iBDn^a^EZ>h&8JTdqQ(km|^DZbz;6j*&@cz zfBIRQ-faA0-KiyOX%?b-u9%QB@-XqoFO$zvYzZ5-?2+^6>BO6!-DQ9CpM;#2U!KNREYd#PC{M?ekU71)zMn5K3dHGfgGKY)oZumeRmr) zXZn()BbB1YDxyVWweVULm9(+dMqE%7p06DV#_KGcXNxlUJKl+gl|H(P=*ig1qn8f33M#~GYAI<^zDMXT z?98?=PCD3pD5{0rq9g01N?~iias9s41kFe50&0o_vV&Bl&TQOlCCFVn0Z#EaFLV;d zU!`11Mgl$AN!F)a;LuSPJnm{a(M)|=z|c`5_TyY~%9Y z1z&D-%4xsbw6(17RI>}WbUS^K>bZ58d&oj8#qey^dKgjuk&?7{=eArca0i&u30h#dm0^x<@E3f%9Zw~}2dxKf({O|g(Mi+$k2gb~iPlY*Kbi5qgea!iJ z%755NM_CwMnsnx%@)TOL@KRIwSnHKzg}(h@Uj#8@5h~oAXU5+f8XOS*O4dz>P8n}Z zzFoI4V_jh`nQu46rQ*;l9aH}_4Q$jO7@0v@zz1p^H4K*{8c+9#1oh+tMT!ZB+XoqS z-Xz6DiQe=AlQ6rRtAw65r@6$(x_P3xSU!v3w6VErSw~hOAB0 z_nhTPZHzxkTUp`?j1kv9j6pb$xsRU=<7*}B<(j~3u^c;8_*0Zz{9 zxm&lRS)OdnSL`cB3X!t%KS>?U8Yw1N$Kv@ZuJNF;@^=0TMNm9zZ?*5QrnyLr-$esU zumr}g&j$*fn3Ne63df1~)3|*dj1Z3y%||X0yq~1kic~qqg~3ZNiPs&t9SX8JoW8EG z4sYHnEc+Yx_KMSlo1Q+nryoWik|WCRpu%fqAjZfAaV094!}!fmnDb*`Bo=v#mNY7| z(2b=gvUZ=iZUcTcnd`t`-y{w)NI7AL$rBWmq)H??tZQ*3U3 Date: Tue, 24 Oct 2017 22:39:29 +0700 Subject: [PATCH 08/14] Replaced print strings with translation strings --- Stephanie/AudioManager/audio_getter.py | 9 +-- Stephanie/AudioManager/audio_recognizer.py | 72 ++++++++++--------- Stephanie/EventDispatcher/event_dispatcher.py | 4 +- Stephanie/Modules/alpha_search_module.py | 14 ++-- Stephanie/Modules/base_module.py | 12 ++-- Stephanie/Modules/evernote_module.py | 10 +-- Stephanie/Modules/facebook_module.py | 37 +++++----- Stephanie/Modules/football_module.py | 22 +++--- Stephanie/Modules/gmail_module.py | 18 +++-- Stephanie/Modules/google_calendar_module.py | 8 +-- Stephanie/Modules/movie_information_module.py | 27 ++++--- Stephanie/Modules/reporter_module.py | 44 ++++++------ Stephanie/Modules/system_module.py | 38 +++++----- Stephanie/Modules/twitter_module.py | 20 +++--- Stephanie/Modules/weather_report_module.py | 28 +++----- Stephanie/Modules/wikipedia_module.py | 22 ++++-- Stephanie/Modules/zomato_module.py | 19 +++-- Stephanie/TextManager/speaker.py | 8 +-- Stephanie/TextManager/text_manager.py | 10 +-- Stephanie/boot.py | 3 + Stephanie/configurer.py | 6 +- Stephanie/updater.py | 66 ++++++++--------- 22 files changed, 254 insertions(+), 243 deletions(-) diff --git a/Stephanie/AudioManager/audio_getter.py b/Stephanie/AudioManager/audio_getter.py index 4e09b4d..c8de6be 100644 --- a/Stephanie/AudioManager/audio_getter.py +++ b/Stephanie/AudioManager/audio_getter.py @@ -8,16 +8,13 @@ def __init__(self, recognizer): self.r = recognizer self.c = config self.speaker = Speaker() - self.start_text = self.c.config['LOGS']['start_text'] - self.listened_success_text = self.c.config['LOGS']['listened_success_text'] - self.listened_error_text = self.c.config['LOGS']['listened_error_text'] self.speech_directory = self.c.config['CORE']['speech_directory'] self.beep_start = self.get_speeches_folder(self.c.config['CORE']['beep_start']) self.beep_end = self.get_speeches_folder(self.c.config['CORE']['beep_end']) self.tts_option = self.c.config['TTS']['tts_player'].lower() def get_audio_from_inbuilt(self, source, signals=True): - print(self.start_text) + print(_("command.ask")) try: if signals: if self.tts_option == "os": @@ -28,7 +25,7 @@ def get_audio_from_inbuilt(self, source, signals=True): raise AssertionError("Fill in the tts_player option in config.ini file as either os or mixer.") self.r.adjust_for_ambient_noise(source, duration=1) audio = self.r.listen(source) - print(self.listened_success_text) + print(_("command.processing")) if signals: if self.tts_option == "os": self.speaker.speak_from_os(self.beep_end) @@ -39,7 +36,7 @@ def get_audio_from_inbuilt(self, source, signals=True): return audio except AssertionError as e: print(e) - print(self.listened_error_text) + print(_("command.ask_repeat")) return False def listen(self, source, signals=True): diff --git a/Stephanie/AudioManager/audio_recognizer.py b/Stephanie/AudioManager/audio_recognizer.py index 9368a80..44cb114 100644 --- a/Stephanie/AudioManager/audio_recognizer.py +++ b/Stephanie/AudioManager/audio_recognizer.py @@ -13,13 +13,13 @@ def recognize_from_sphinx(self, audio): # recognize speech using Sphinx try: text = self.r.recognize_sphinx(audio) - print(_("Sphinx thinks you said ") + text) + print(_("audio.repeat_input").format("Sphinx", text)) return text except self.UnknownValueError: - print(_("Sphinx could not understand audio")) + print(_("error.audio.failed_understand").format("Sphinx")) return False except self.RequestError as e: - print(_("Sphinx error; {0}").format(e)) + print(_("error.audio.failed_request_service").format("Sphinx", e)) return False def recognize_from_google(self, audio): @@ -28,15 +28,15 @@ def recognize_from_google(self, audio): # to use another API key, use `r.recognize_google(audio, key="GOOGLE_SPEECH_RECOGNITION_API_KEY")` # instead of `r.recognize_google(audio)` text = self.r.recognize_google(audio) - print(_("Google Speech Recognition thinks you said ") + text) + print(_("audio.repeat_input").format("Google Speech Recognition", text)) return text except KeyError: - print(_("Google Recognition couldn't understand your audio with enough confidence.")) + print(_("error.audio.google_recognition.failed_understand")) except self.UnknownValueError: - print(_("Google Speech Recognition could not understand audio")) + print(_("error.audio.failed_understand").format("Google Speech Recognition")) return False except self.RequestError as e: - print(_("Could not request results from Google Speech Recognition service; {0}").format(e)) + print(_("error.audio.failed_request_service").format("Google Speech Recognition", e)) return False def recognize_from_google_cloud(self, audio): @@ -44,98 +44,100 @@ def recognize_from_google_cloud(self, audio): try: google_cloud_speech_credentials = self.c.config['STT_KEYS']['google_cloud_speech_api'] except KeyError: - print(_("Api key not found in the config.ini file.")) + print(_("error.missing_api_key")) return False try: text = self.r.recognize_google_cloud(audio, credentials_json=google_cloud_speech_credentials) - print(_("Google Cloud Speech thinks you said ") + text) + print(_("audio.repeat_input").format("Google Cloud Speech", text)) return text except self.UnknownValueError: - print(_("Google Cloud Speech could not understand audio")) + print(_("error.audio.failed_understand").format("Google Cloud Speech")) return False except self.RequestError as e: - print(_("Could not request results from Google Cloud Speech service; {0}").format(e)) + print(_("error.audio.failed_request_service").format("Google Cloud Speech", e)) return False def recognize_from_wit(self, audio): # recognize speech using Wit.ai try: - wit_ai_key = self.c.config['STT_KEYS'][ - 'wit.ai_speech_api'] # Wit.ai keys are 32-character uppercase alphanumeric strings + # Wit.ai keys are 32-character uppercase alphanumeric strings + wit_ai_key = self.c.config['STT_KEYS']['wit.ai_speech_api'] except KeyError: - print(_("Api key not found in the config.ini file.")) + print(_("error.missing_api_key")) return False try: text = self.r.recognize_wit(audio, key=wit_ai_key) - print(_("Wit.ai thinks you said ") + text) + print(_("audio.repeat_input").format("Wit.ai", text)) return text except self.UnknownValueError: - print(_("Wit.ai could not understand audio")) + print(_("error.audio.failed_understand").format("Wit.ai")) return False except self.RequestError as e: - print(_("Could not request results from Wit.ai service; {0}").format(e)) + print(_("error.audio.failed_request_service").format("Wit.ai", e)) return False def recognize_from_bing(self, audio): # recognize speech using Microsoft Bing Voice Recognition - # Microsoft Bing Voice Recognition API keys 32-character lowercase hexadecimal strings + # Microsoft Bing Voice Recognition API keys 32-character + # lowercase hexadecimal strings try: bing_key = self.c.config['STT_KEYS']['bing_speech_api'] except KeyError: - print(_("Api key not found in the config.ini file.")) + print(_("error.missing_api_key")) return False try: text = self.r.recognize_bing(audio, key=bing_key) - print(_("Microsoft Bing Voice Recognition thinks you said ") + text) + print(_("audio.repeat_input").format("Microsoft Bing Voice Recognition", text)) return text except self.UnknownValueError: - print(_("Microsoft Bing Voice Recognition could not understand audio")) + print(_("error.audio.failed_understand").format("Microsoft Bing Voice Recognition")) return False except self.RequestError as e: - print(_("Could not request results from Microsoft Bing Voice Recognition service; {0}").format(e)) + print(_("error.audio.failed_request_service").format("Microsoft Bing Voice Recognition", e)) return False def recognize_from_houndify(self, audio): # recognize speech using Houndify try: - houndify_client_id = self.c.config['STT_KEYS'][ - 'houndify_client_id'] # Houndify client IDs are Base64-encoded strings - houndify_client_key = self.c.config['STT_KEYS'][ - 'houndify_client_key'] # Houndify client keys are Base64-encoded strings + # Houndify client IDs are Base64-encoded strings + houndify_client_id = self.c.config['STT_KEYS']['houndify_client_id'] + # Houndify client keys are Base64-encoded strings + houndify_client_key = self.c.config['STT_KEYS']['houndify_client_key'] except KeyError: - print(_("Api key not found in the config.ini file.")) + print(_("error.missing_api_key")) return False try: text = self.r.recognize_houndify(audio, client_id=houndify_client_id, client_key=houndify_client_key) - print(_("Houndify thinks you said ") + text) + print(_("audio.repeat_input").format("Houndify", text)) return text except self.UnknownValueError: - print(_("Houndify could not understand audio")) + print(_("error.audio.failed_understand").format("Houndify")) return False except self.RequestError as e: - print(_("Could not request results from Houndify service; {0}").format(e)) + print(_("error.audio.failed_request_service").format("Houndify", e)) return False def recognize_from_ibm(self, audio): # recognize speech using IBM Speech to Text try: - # IBM Speech to Text usernames are strings of the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + # IBM Speech to Text usernames are strings of the + # form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX ibm_username = self.c.config['STT_KEYS']['ibm_username'] # IBM Speech to Text passwords are mixed-case alphanumeric strings ibm_password = self.c.config['STT_KEYS']['ibm_password'] except KeyError: - print(_("Api key not found in the config.ini file.")) + print(_("error.missing_api_key")) return False try: text = self.r.recognize_ibm(audio, username=ibm_username, password=ibm_password) - print(_("IBM Speech to Text thinks you said ") + text) + print(_("audio.repeat_input").format("IBM Speech to Text", text)) return text except self.UnknownValueError: - print(_("IBM Speech to Text could not understand audio")) + print(_("error.audio.failed_understand").format("IBM Speech to Text")) return False except self.RequestError as e: - print(_("Could not request results from IBM Speech to Text service; {0}").format(e)) + print(_("error.audio.failed_request_service").format("IBM Speech to Text", e)) return False diff --git a/Stephanie/EventDispatcher/event_dispatcher.py b/Stephanie/EventDispatcher/event_dispatcher.py index 070156d..dc1fbd2 100644 --- a/Stephanie/EventDispatcher/event_dispatcher.py +++ b/Stephanie/EventDispatcher/event_dispatcher.py @@ -12,12 +12,12 @@ def close(self): def sleep(self, sender): self.sleep_status = True - print("The virtual assistant is going to sleep by %s method" % sender) + print(_("The virtual assistant is going to sleep by {0} method").format(sender)) return self def quit(self, sender): self.active_status = True - print("The virtual assistant is being quit by %s method" % sender) + print(_("The virtual assistant is being quit by {0} method").format(sender)) def add(self, handle_name): handle_event = getattr(self, handle_name) diff --git a/Stephanie/Modules/alpha_search_module.py b/Stephanie/Modules/alpha_search_module.py index 9094c1f..48b2484 100644 --- a/Stephanie/Modules/alpha_search_module.py +++ b/Stephanie/Modules/alpha_search_module.py @@ -23,18 +23,18 @@ def do_a_search(self): elif raw_text_array[i] == "search": status = True if status is False: - return "Can you possibly phrase it a bit better?" + return _("Can you possibly phrase it a bit better?") phrase = phrase.strip() try: text = self.client.search(phrase) except ConfidenceError: - return "Sorry, I couldn't find what you asked for, maybe try being a little more specific." + return _("Sorry, I couldn't find what you asked for, maybe try being a little more specific.") except InternalError: - return "It seems something is wrong with the wolframalpha search engine, maybe try asking later." + return _("It seems something is wrong with the wolframalpha search engine, maybe try asking later.") except MissingTokenError: - return "Seems you haven't provided the API TOKEN for search engine, please add it in config file." - print("API TOKEN for wolframalpha search engine is missing, head in to docs to see how to properly fill the configurations for search engine.") + return _("Seems you haven't provided the API TOKEN for search engine, please add it in config file.") + print(_("API TOKEN for wolframalpha search engine is missing, head in to docs to see how to properly fill the configurations for search engine.")) except InvalidTokenError: - return "Seems you haven't provided the API TOKEN or it's wrong for search engine, please add it in config file." - print("API TOKEN for wolframalpha search engine is missing or is invalid, head in to docs to see how to properly fill the configurations for search engine.") + return _("Seems you haven't provided the API TOKEN or it's wrong for search engine, please add it in config file.") + print(_("API TOKEN for wolframalpha search engine is missing or is invalid, head in to docs to see how to properly fill the configurations for search engine.")) return text diff --git a/Stephanie/Modules/base_module.py b/Stephanie/Modules/base_module.py index 4218dc2..577856f 100644 --- a/Stephanie/Modules/base_module.py +++ b/Stephanie/Modules/base_module.py @@ -15,14 +15,14 @@ def get_configuration(self, key, section="MODULES"): try: value = self.config[section][key] except KeyError: - print("API KEYS FOR '%s' is not provided in the config.ini file." - " Refer back to the docs, or just add the goddamn key." % key) + print(_("API KEYS FOR {0} is not provided in the config.ini file." + " Refer back to the docs, or just add the goddamn key.").format(key)) return False if value: return value - print("The correct API KEY wasn't provided or wasn't provided at all for %s, what the ... okay man" - " now look back at docs to find how to do that, is pretty simple just one line long. " - "Lazy ass" % key) + print(_("The correct API KEY wasn't provided or wasn't provided at all for {0}, what the ... okay man" + " now look back at docs to find how to do that, is pretty simple just one line long. " + "Lazy ass").format(key)) return False def write_configuration(self, key, value, section="MODULES"): @@ -30,4 +30,4 @@ def write_configuration(self, key, value, section="MODULES"): with open(self.parent_configuration.abs_filename, 'w') as configfile: self.config.write(configfile) configfile.close() - return value \ No newline at end of file + return value diff --git a/Stephanie/Modules/evernote_module.py b/Stephanie/Modules/evernote_module.py index 56b8c29..9b4c7f6 100644 --- a/Stephanie/Modules/evernote_module.py +++ b/Stephanie/Modules/evernote_module.py @@ -33,15 +33,15 @@ def write_note(self): try: created_note = self.note_store.createNote(note) # Stores the new note in Evernote except: - response = ("Note wasn't created successfully, you probably didn't spelled anything or spelled really " - "bad, Not my fault okay? It's never a program's fault.") + response = (_("Note wasn't created successfully, you probably didn't spelled anything or spelled really " + "bad, Not my fault okay? It's never a program's fault.")) print(response) return response if created_note: - return "I successfully wrote down your note." + return _("I successfully wrote down your note.") else: - response = ("Note wasn't created successfully, you probably didn't spelled anything or spelled really " - "bad, Not my fault okay? It's never a program's fault. /s Refer back to docs.") + response = (_("Note wasn't created successfully, you probably didn't spelled anything or spelled really " + "bad, Not my fault okay? It's never a program's fault. /s Refer back to docs.")) print(response) return response diff --git a/Stephanie/Modules/facebook_module.py b/Stephanie/Modules/facebook_module.py index 678ff5e..ed8608c 100644 --- a/Stephanie/Modules/facebook_module.py +++ b/Stephanie/Modules/facebook_module.py @@ -56,12 +56,12 @@ def get_birthday_reminders(self): results = self.graph.request("me/friends", args={'fields': 'id,name,birthday'}) except facebook.GraphAPIError: - response = ("I have not been authorized to query your Facebook. If you " + - "would like to check birthdays in the future, please visit " + - "the Jasper dashboard.") + response = (_("I have not been authorized to query your Facebook. If you " + + "would like to check birthdays in the future, please visit " + + "the Jasper dashboard.")) return response except: - return "I apologize, there's a problem with that service at the moment." + return _("I apologize, there's a problem with that service at the moment.") needle = datetime.datetime.now(tz=pytz.utc).strftime("%m/%d") @@ -75,12 +75,12 @@ def get_birthday_reminders(self): if len(people) > 0: if len(people) == 1: - output = people[0] + " has a birthday today." + output = _("{0} has a birthday today.").format(people[0]) else: - output = "Your friends with birthdays today are " + \ - ", ".join(people[:-1]) + " and " + people[-1] + "." + output = _("Your friends with birthdays today are ") + \ + ", ".join(people[:-1]) + _(" and ") + people[-1] + "." else: - output = "None of your friends have birthdays today." + output = _("None of your friends have birthdays today.") return output @@ -100,22 +100,21 @@ def get_notifications(self): try: results = self.graph.request("me/notifications") except facebook.GraphAPIError: - response = ("I have not been authorized to query your Facebook. If you " + - "would like to check your notifications in the future, " + - "please visit the Stephanie facebook module configuraton.") + response = (_("I have not been authorized to query your Facebook. If you " + + "would like to check your notifications in the future, " + + "please visit the Stephanie facebook module configuraton.")) return response except: - return "I apologize, there's a problem with that service at the moment." + return _("I apologize, there's a problem with that service at the moment.") if not len(results['data']): - return "You have no Facebook notifications." + return _("You have no Facebook notifications.") updates = [] for notification in results['data']: updates.append(notification['title']) count = len(results['data']) - response = ("You have " + str(count) + - " Facebook notifications. " + " ".join(updates) + ". ") + response = (_("You have {0} Facebook notifications. ").format(str(count)) + " ".join(updates) + ". ") return response @@ -126,9 +125,9 @@ def status_update(self): self.graph.put_wall_post(text) self.assistant.say("You have successully put up a wall post.") except facebook.GraphAPIError: - response = ("I have not been authorized to query your Facebook. If you " + - "would like to check your notifications in the future, " + - "please visit the Stephanie facebook module configuraton.") + response = (_("I have not been authorized to query your Facebook. If you " + + "would like to check your notifications in the future, " + + "please visit the Stephanie facebook module configuraton.")) return response except: - return "I apologize, there's a problem with that service at the moment." + return _("I apologize, there's a problem with that service at the moment.") diff --git a/Stephanie/Modules/football_module.py b/Stephanie/Modules/football_module.py index 920230b..474244f 100644 --- a/Stephanie/Modules/football_module.py +++ b/Stephanie/Modules/football_module.py @@ -85,8 +85,8 @@ def get_general_league(self, competition_id): ) while not active: response = self.fm.get_specific_competition(competition_id) - self.assistant.say("%s, would you like to know about it's latest news, league table or " - " maybe fixtures?" % response) + self.assistant.say("{0}, would you like to know about it's latest news, league table or " + " maybe fixtures?".format(response)) text = self.assistant.listen().decipher() module_func = self.assistant.understand(modules, text) active = getattr(self, module_func)() @@ -100,7 +100,7 @@ def league_specific_table(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def league_specific_next_fixtures(self): @@ -111,7 +111,7 @@ def league_specific_next_fixtures(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def league_specific_previous_fixtures(self): @@ -163,7 +163,7 @@ def team_previous_fixtures(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def league_specific_news(self): @@ -174,7 +174,7 @@ def league_specific_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def team_specific_news(self): @@ -185,7 +185,7 @@ def team_specific_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def team_news(self): @@ -196,7 +196,7 @@ def team_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def team_injury_news(self): @@ -207,7 +207,7 @@ def team_injury_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def team_transfer_talk(self): @@ -218,7 +218,7 @@ def team_transfer_talk(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False def get_news(self): @@ -229,5 +229,5 @@ def get_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return "Alright then blimey." + return _("Alright then blimey.") return False diff --git a/Stephanie/Modules/gmail_module.py b/Stephanie/Modules/gmail_module.py index 4c6098f..b983f2e 100644 --- a/Stephanie/Modules/gmail_module.py +++ b/Stephanie/Modules/gmail_module.py @@ -22,7 +22,7 @@ def do_init(self): self.conn.debug = 0 self.conn.login(self.gmail_address, self.password) except: - response = ("Either your credentials are wrong mate, or there is some problem going on, do me a favor, I know " + response = _("Either your credentials are wrong mate, or there is some problem going on, do me a favor, I know " "you won't but whatever, just inform me in the forums.") print(response) return response @@ -113,27 +113,25 @@ def handle(self): num_unread, msgs = self.fetch_unread_emails(limit=5) if num_unread > 5: - response = "You have %d unread emails, out of which 5 latest ones are as follows, please wait a second, as I process" % num_unread + response = _("You have {0} unread emails, out of which 5 latest ones are as follows, please wait a second, as I process").format(num_unread) self.assistant.say(response) senders = [] for e in msgs: senders.append(self.get_sender(e)) except imaplib.IMAP4.error: - return "I'm sorry. I'm not authenticated to work with your Gmail." + return _("I'm sorry. I'm not authenticated to work with your Gmail.") if not senders: - return "You have no unread emails." + return _("You have no unread emails.") elif len(senders) == 1: - return "You have one unread email from " + senders[0] + "." + return _("You have one unread email from {0}.").format(senders[0]) else: - response = "You have %d unread emails" % len( - senders) + response = _("You have {0} unread emails").format(len(senders)) unique_senders = list(set(senders)) if len(unique_senders) > 1: - unique_senders[-1] = 'and ' + unique_senders[-1] - response += ". Senders include: " + response += _(". Senders include: ") response += '...'.join(senders) else: - response += " from " + unique_senders[0] + response += _(" from ") + unique_senders[0] return response diff --git a/Stephanie/Modules/google_calendar_module.py b/Stephanie/Modules/google_calendar_module.py index 6c4f507..2bad758 100644 --- a/Stephanie/Modules/google_calendar_module.py +++ b/Stephanie/Modules/google_calendar_module.py @@ -121,7 +121,7 @@ def add_event(self): user_response = self.assistant.listen().decipher() if bool(re.search('Yes', user_response, re.IGNORECASE)): - return "Okay, I added it to your calendar" + return _("Okay, I added it to your calendar") self.service.events().delete(calendarId='primary', eventId=created_event['id']).execute() @@ -151,7 +151,7 @@ def get_events_today(self): timeMin=today_start_time, timeMax=today_end_time).execute() if len(events_found['items']) == 0: - return "You have no events scheduled for today" + return _("You have no events scheduled for today") for event_found in events_found['items']: @@ -217,7 +217,7 @@ def get_events_tomorrow(self): timeMax=tomorrow_end_time ).execute() if len(events['items']) == 0: - return "You have no events scheduled Tomorrow" + return _("You have no events scheduled Tomorrow") for event in events['items']: @@ -250,4 +250,4 @@ def get_events_tomorrow(self): page_token = events.get('nextPageToken') if not page_token: - return "That's it." + return _("That's it.") diff --git a/Stephanie/Modules/movie_information_module.py b/Stephanie/Modules/movie_information_module.py index 35f2017..5966bd9 100644 --- a/Stephanie/Modules/movie_information_module.py +++ b/Stephanie/Modules/movie_information_module.py @@ -14,28 +14,35 @@ def give_some_information(self): movies.sort(key=lambda x: x.year, reverse=True) for i in range(0, len(movies)): if i == 0: - speech = "Is the movie you're referring to is %s, released in %s" % ( + speech = _("Is the movie you're referring to {0}, released in {1}").format( movies[i].title, movies[i].year) else: - speech = "Alright, then how about %s, released in %s" % ( + speech = _("Alright, then how about {0}, released in {1}").format( movies[i].title, movies[i].year) self.assistant.say(speech) response = self.assistant.listen().decipher() if len(response.split()) > 3: - return "Alright dude, you are kind of moody." + return _("Alright dude, you are kind of moody.") elif response == "yes": imdb_id = movies[i].imdb_id - print("found") + print(_("found")) return self.give_movie_information_from_imdb_id(imdb_id) else: - return "Sorry, but your pronounciation is awful. Try again" + return _("Sorry, but your pronounciation is awful. Try again") @staticmethod def give_movie_information_from_imdb_id(imdb_id): movie = omdb.imdbid(imdb_id) - speech = "%s was released in %s, directed by %s of genre %s has a runtime of about %s" \ - "garnered a rating of %s featuring %s had a plot such as %s" % (movie.title, movie.released, - movie.director, movie.genre, - movie.runtime, movie.imdb_rating, - movie.actors, movie.plot) + speech = _("{0} was released in {1}, directed by {2} of genre {3}" + "has a runtime of about {4} garnered a rating of {5} " + "featuring {6} had a plot such as {7}").format( + movie.title, + movie.released, + movie.director, + movie.genre, + movie.runtime, + movie.imdb_rating, + movie.actors, + movie.plot + ) return speech diff --git a/Stephanie/Modules/reporter_module.py b/Stephanie/Modules/reporter_module.py index d77ba37..f35951a 100644 --- a/Stephanie/Modules/reporter_module.py +++ b/Stephanie/Modules/reporter_module.py @@ -15,7 +15,7 @@ def __init__(self, *args): self.articles = Articles(self.API_KEY) self.sources = Sources(self.API_KEY) else: - print("Kindly look back at the documentation to configure news module properly especially the API keys.") + print(_("Kindly look back at the documentation to configure news module properly especially the API keys.")) return False self.sources_url = {} self.sources.information() @@ -38,40 +38,40 @@ def all_sources(self): return self.sources_url def get_news(self): - self.assistant.say("Would you prefer any specific category? If yes then what would it be?") + self.assistant.say(_("Would you prefer any specific category? If yes then what would it be?")) category_status = self.assistant.listen().decipher() if category_status.upper() in self.NEGATIVE: category = False else: categories = self.get_all_categories() category = self.search(categories, category_status) - self.assistant.say("Any preference you would like to have about source of your news? like CNN" - "or Time magazine or maybe The hindu?") + self.assistant.say(_("Any preference you would like to have about source of your news? like CNN" + "or Time magazine or maybe The hindu?")) source_status = self.assistant.listen().decipher() if source_status.upper() in self.NEGATIVE: source = False else: if category: sources_available = self.get_by_category(category) - response = "Out of all the sources as follows" + response = _("Out of all the sources as follows") for source_name, source_url in sources_available.items(): response += " %s," % source_name - response += ", which one would you like to pick?" + response += _(", which one would you like to pick?") self.assistant.say(response) source_command = self.assistant.listen().decipher() source = self.search(list(sources_available), source_command) else: - self.assistant.say("So would you want me to list all the sources around 70 which to be" - "honest would be a hefty task, so if not, then just let me know of" - "your source name and I would let you know if it's available or not.") + self.assistant.say(_("So would you want me to list all the sources around 70 which to be" + "honest would be a hefty task, so if not, then just let me know of" + "your source name and I would let you know if it's available or not.")) all_sources_status = self.assistant.listen().decipher() sources_available = self.all_sources() if all_sources_status.upper() in self.AFFIRMATIVE: - response = "Good job, lazy ass, so here are all the available sources as follows " + response = _("Good job, lazy ass, so here are all the available sources as follows ") sources_available_list = list(sources_available) for source_name in sources_available_list: response += " %s," % source_name - response += ", which one would you like to pick?" + response += _(", which one would you like to pick?)" self.assistant.say(response) source_command = self.assistant.listen().decipher() all_sources_status = source_command @@ -83,19 +83,19 @@ def get_news(self): sort_by = sort_bys_available[0] else: if len(sort_bys_available) == 2: - response = "And what kind of news sort would you like? " \ - "%s or %s?" % (sort_bys_available[0], sort_bys_available[1]) + response = _("And what kind of news sort would you like? {0} or {1}?").format(sort_bys_available[0], sort_bys_available[1]) else: - response = "And what kind of news sort would you like? " \ - "%s or %s, or maybe %s?" % (sort_bys_available[0], - sort_bys_available[1], - sort_bys_available[2]) + response = _("And what kind of news sort would you like? {0} or {1}, or maybe {2}?").format( + sort_bys_available[0], + sort_bys_available[1], + sort_bys_available[2], + ) self.assistant.say(response) sort_by_command = self.assistant.listen().decipher() sort_by = self.search(sort_bys_available, sort_by_command) else: - self.assistant.say("And what kind of news sort would you like?" - "latest or maybe top ones shown in front page?") + self.assistant.say(_("And what kind of news sort would you like?" + "latest or maybe top ones shown in front page?")) sort_status_command = self.assistant.listen().decipher() sort_by = self.search(['top', 'popular' 'latest'], sort_status_command) if not source: @@ -119,15 +119,15 @@ def get_response(self, source, sort_by=None, threshold=5): source = source.lower().replace(" ", "-") articles = self.articles.get(source, sort_by=sort_by).articles articles = articles[:threshold] - response = "So the %s news from %s news source are as follows " % (sort_by, source) + response = _("So the {0} news from {1} news source are as follows ").format(sort_by, source) for article in articles: if article['title']: response += "%s, " % article['title'] if article['description']: response += "%s, " % article['description'] if article['author']: - response += "was reported by %s." % article['author'] - response += "and in the other news. " + response += _("was reported by {0}.").format(article['author']) + response += _("and in the other news. ") return response @staticmethod diff --git a/Stephanie/Modules/system_module.py b/Stephanie/Modules/system_module.py index 8828289..22d1d99 100644 --- a/Stephanie/Modules/system_module.py +++ b/Stephanie/Modules/system_module.py @@ -9,10 +9,10 @@ def __init__(self, *args): self.gender = self.get_configuration(section="USER", key="gender") def default(self): - return "Repeat back your command!." + return _("Repeat back your command!.") def meaning_of_life(self): - return "42 is the meaning of life." + return _("42 is the meaning of life.") def time_right_now(self): t = dt.datetime.now() @@ -27,15 +27,15 @@ def wake_up(self): if self.gender: gender = self.gender.lower() if gender == "male": - return "%s, sir!" % self.phase_of_the_day(t) + return _("{0}, sir!").format(self.phase_of_the_day(t)) elif gender == "female": - return "%s, sir!" % self.phase_of_the_day(t) + return _("{0}, mam!").format(self.phase_of_the_day(t)) else: - return "%s, sir!" % self.phase_of_the_day(t) + return _("{0}, dear!").format(self.phase_of_the_day(t)) elif self.name: - return "%s, %s!" % (self.phase_of_the_day(t), self.name) + return "{0}, {1}!".format(self.phase_of_the_day(t), self.name) else: - return "%s!" % self.phase_of_the_day(t) + return "{0}!".format(self.phase_of_the_day(t)) # Example to access assistant instance # def wake_up(self): # self.assistant.say("What time is it again?") @@ -44,11 +44,11 @@ def wake_up(self): def go_to_sleep(self): self.assistant.events.add("sleep").trigger("sleep") - return "Sleep for the weak!" + return _("Sleep for the weak!") def quit(self): self.assistant.events.add("quit").trigger("quit") - return "I will come back stronger!" + return _("I will come back stronger!") def tell_system_status(self): import psutil @@ -63,12 +63,12 @@ def tell_system_status(self): disk_percent = psutil.disk_usage('/')[3] boot_time = datetime.datetime.fromtimestamp(psutil.boot_time()) running_since = boot_time.strftime("%A %d. %B %Y") - response = "I am currently running on %s version %s. " % (os, version) - response += "This system is named %s and has %s CPU cores. " % (name, cores) - response += "Current disk_percent is %s percent. " % disk_percent - response += "Current CPU utilization is %s percent. " % cpu_percent - response += "Current memory utilization is %s percent. " % memory_percent - response += "it's running since %s." % running_since + response = _("I am currently running on {0} version {1}. ").format(os, version) + response += _("This system is named {0} and has {1} CPU cores. ").format(name, cores) + response += _("Current disk_percent is {0} percent. ").format(disk_percent) + response += _("Current CPU utilization is {0} percent. ").format(cpu_percent) + response += _("Current memory utilization is {0} percent. ").format(memory_percent) + response += _("it's running since {0}.").format(running_since) return response @staticmethod @@ -108,7 +108,7 @@ def time_teller(time): # hour = d[hour] # minute = d[minute] - return "The time is %s %s %s" % (hour, minute, phase) + return _("The time is {0} {1} {2}").format(hour, minute, phase) # # hour = d[int(t[0:2])] if t[0:2] != "00" else d[12] # # suffix = 'a.m.' if d[int(t[7:9])] == hour else 'p.m.' @@ -131,8 +131,8 @@ def date_teller(date): def phase_of_the_day(time): hour = time.hour if hour < 12: - return 'Good Morning' + return _('Good Morning') elif 12 <= hour < 18: - return 'Good Afternoon' + return _('Good Afternoon') if hour > 6: - return 'Good Evening' + return _('Good Evening') diff --git a/Stephanie/Modules/twitter_module.py b/Stephanie/Modules/twitter_module.py index 0274e23..400f7f5 100644 --- a/Stephanie/Modules/twitter_module.py +++ b/Stephanie/Modules/twitter_module.py @@ -39,13 +39,13 @@ def get_trending(self): name = trend['name'] # Grabs name of each trend if name.startswith('#'): self.assistant.say(name) # Only grabs hashtags - return "these were the top 5 trends on twitter globally." + return _("these were the top 5 trends on twitter globally.") def status_update(self): - self.assistant.say("What would you like to tweet?") + self.assistant.say(_("What would you like to tweet?")) tweet = self.assistant.listen().decipher() self.api.update_status(tweet) - return "%s has been tweeted" % tweet + return _("{0} has been tweeted").format(tweet) def get_notifications(self): latest_retweets = [] @@ -72,20 +72,20 @@ def get_notifications(self): # latest_direct_messages_id.append(directMessage.id) response = "" if len(latest_retweets) > 0: - response += "Latest Retweets are " + response += _("Latest Retweets are ") for retweetFinal in latest_retweets: - response += (retweetFinal.text + " by " + retweetFinal.user.screen_name + ". ") + response += (retweetFinal.text + _(" by ") + retweetFinal.user.screen_name + ". ") else: - response += ("You have no re-tweets. ") + response += _("You have no re-tweets. ") if len(latest_mentions) > 0: - response += ("Latest Mentions are ") + response += _("Latest Mentions are ") for mentionFinal in latest_mentions: - response += (mentionFinal.text + " from " + mentionFinal.user.screen_name + ". ") + response += (mentionFinal.text + _(" from ") + mentionFinal.user.screen_name + ". ") else: - response += ("You have no mentions. ") + response += _("You have no mentions. ") # if len(latest_direct_messages) > 0: # self.assistant.say("Latest Direct Messages are") @@ -95,5 +95,5 @@ def get_notifications(self): # # else: # self.assistant.say("You have no Direct Messages") - response += "These were the latest notifications." + response += _("These were the latest notifications.") return response diff --git a/Stephanie/Modules/weather_report_module.py b/Stephanie/Modules/weather_report_module.py index 56cac65..6109681 100644 --- a/Stephanie/Modules/weather_report_module.py +++ b/Stephanie/Modules/weather_report_module.py @@ -65,30 +65,22 @@ def get_weather_report(self, weather, loc, temp_unit='celsius', report='current' temp_max = self.num_service.parseMagnitude(temp['temp_max']) temp_min = self.num_service.parseMagnitude(temp['temp_min']) curr_temp = self.num_service.parseMagnitude(temp['temp']) - weather_report = "Weather at " + loc + ". Today is " + stat + ". There is a chance of " \ - + detstat + ". Now Temperature is " + curr_temp + " degree " \ - + temp_unit + ". Humidity " + humi + " percent. Wind Speed " \ - + wind_speed + ". with cloud cover " + clou + " percent." + weather_report = _("Weather at {0}. Today is {1}. There is a chance of {2}. Now Temperature is {3} degree {4}. Humidity {5} percent. Wind Speed {6} with cloud cover {7} percent.").format(loc, stat, detstat, curr_temp, temp_unit, humi, wind_speed, clou); elif report == 'tomorrow': temp = weather.get_temperature(temp_unit) temp_morn = self.num_service.parseMagnitude(temp['morn']) temp_day = self.num_service.parseMagnitude(temp['day']) temp_night = self.num_service.parseMagnitude(temp['night']) - weather_report = "Weather at " + loc + ". Tomorrow will be " + stat + ". There will be a chance of " \ - + detstat + ". Temperature in the morning " + temp_morn + " degree " \ - + temp_unit + ". Days Temperature will be " + temp_day + " degree " \ - + temp_unit + ". and Temperature at night will be " + temp_night + " degree " \ - + temp_unit + ". Humidity " + humi + " percent. Wind Speed " \ - + wind_speed + ". with clouds cover " + clou + " percent." + weather_report = _("Weather at {0}. Tomorrow will be {1}. There will be a chance of {2}. Temperature in the morning {3} degree {4}. Days Temperature will be {5} degree {4}. and Temperature at night will be {6} degree {4}. Humidity {7} percent. Wind Speed {8} with clouds cover {9} percent.").format(loc, stat, destat, temp_morn, temp_unit, temp_day, temp_night, humi, wind_speed, clou) return weather_report def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report='current'): - weather_report = "Weather forecast for next week at " + loc + ". " + weather_report = _("Weather forecast for next week at {0}. ").format(loc) rainy_days = len(forecast.when_rain()) if rainy_days > 0: - rainy_days_str = "Rainy Days are. " + rainy_days_str = _("Rainy Days are ") for d in range(rainy_days): rain_day = forecast.when_rain()[d].get_reference_time() date_str = self.format_time_stamp(rain_day) @@ -99,7 +91,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_rainy = forecast.most_rainy() if most_rainy: - weather_report += "You will observe heavy rain on. " + weather_report += _("You will observe heavy rain on ") ref_time = most_rainy.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -107,7 +99,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' sunny_days = len(forecast.when_sun()) if sunny_days > 0: - sunny_days_str = "Sunny Days are. " + sunny_days_str = _("Sunny Days are ") for d in range(sunny_days): sunny_day = forecast.when_sun()[d].get_reference_time() date_str = self.format_time_stamp(sunny_day) @@ -118,7 +110,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_hot = forecast.most_hot() if most_hot: - weather_report += "You will feel heat on. " + weather_report += _("You will feel heat on ") ref_time = most_hot.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -126,7 +118,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_windy = forecast.most_windy() if most_windy: - weather_report += "Most windy day will be. " + weather_report += _("Most windy day will be ") ref_time = most_windy.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -134,7 +126,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_humid = forecast.most_humid() if most_humid: - weather_report += "Most humid day will be. " + weather_report += _("Most humid day will be ") ref_time = most_humid.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -142,7 +134,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_cold = forecast.most_cold() if most_cold: - weather_report += "Coolest day will be. " + weather_report += _("Coolest day will be ") ref_time = most_cold.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " diff --git a/Stephanie/Modules/wikipedia_module.py b/Stephanie/Modules/wikipedia_module.py index bc54db9..aa12a04 100644 --- a/Stephanie/Modules/wikipedia_module.py +++ b/Stephanie/Modules/wikipedia_module.py @@ -2,18 +2,21 @@ from urllib.error import URLError import json from Stephanie.Modules.base_module import BaseModule - +from Stephanie.language import lang +from pprint import pprint class WikipediaModule(BaseModule): def __init__(self, *args): super(WikipediaModule, self).__init__(*args) def give_a_summary(self): - self.assistant.say("What would you like to know about?") + # Translate this \/ + self.assistant.say(_("What would you like to know about?")) text = self.assistant.listen().decipher() + # add beep sound text = text.strip().replace(" ", "%20") request = Request( - 'https://en.wikipedia.org/w/api.php?' + 'https://' + lang.get_code() + '.wikipedia.org/w/api.php?' 'format=json&action=query&prop=extracts&exintro=&explaintext=&titles=' + text ) try: @@ -24,8 +27,17 @@ def give_a_summary(self): ) ) output = data["query"]["pages"] - final = output[list(output.keys())[0]]["extract"] + # check that the content of output contains a page or not + if list(output.keys())[0] is not '-1': # some page has been found + final = output[list(output.keys())[0]]["extract"] + return final + else: + # Translate this \/ + self.assistant.say(_("Sorry, I couldn't find any article with that title. :sadface:")) + return None + + # handle final being None if the page wasn't found return final except URLError: - return "Unable to search your given query." + return _("Unable to search your given query.") diff --git a/Stephanie/Modules/zomato_module.py b/Stephanie/Modules/zomato_module.py index bfaa1ab..2c7785d 100644 --- a/Stephanie/Modules/zomato_module.py +++ b/Stephanie/Modules/zomato_module.py @@ -16,17 +16,16 @@ def __init__(self, *args): def handle(self): status = self.z.set_location(self.city) if not status: - return "Your api key wasn't provided or maybe your city isn't available." + return _("Your api key wasn't provided or maybe your city isn't available.") rests = self.z.get_location_details() if not rests: - return "No good places to eat found nearby your location." + return _("No good places to eat found nearby your location.") for rest in rests: rest = rest['restaurant'] - self.assistant.say("%s situated nearby %s is found, it offers cuisines like %s " - "with an average price range of %s %s per person, and over %s people have" - "rated this place with an average ratings as %s. " - "So would you like to order this place?" - % ( + self.assistant.say(_("{0} situated nearby {1} is found, it offers cuisines like {2} " + "with an average price range of {3} {4} per person, and over {5} people have" + "rated this place with an average ratings as{6}. " + "So would you like to order this place?").format( rest['name'], rest['location']['locality'], rest['cuisines'], @@ -38,6 +37,6 @@ def handle(self): text = self.assistant.listen().decipher() if text.upper() in self.AFFIRMATIVE: webbrowser.open(rest['url']) - return "Thank you." - self.assistant.say("okay, then how about this one? ") - return "That's all the restaurants available near your location." + return _("Thank you.") + self.assistant.say(_("okay, then how about this one? ")) + return _("That's all the restaurants available near your location.") diff --git a/Stephanie/TextManager/speaker.py b/Stephanie/TextManager/speaker.py index ddeaf0f..d46ba81 100644 --- a/Stephanie/TextManager/speaker.py +++ b/Stephanie/TextManager/speaker.py @@ -23,13 +23,13 @@ def speak_from_os(self, speech_result_filename): else: os.system(self.speak_result) except: - print("Default Audio Player for mp3 files is not set up, like vlc or something.") + print(_("Default Audio Player for mp3 files is not set up, like vlc or something.")) try: self.hibernate() except: - print("Seems like eyed3 named package wasn't installed probably " - "Check back at the support tab in the main website. Or if you're " - "trying to close the application abruptly, keep pressing CTRL + C repeatedly.") + print(_("Seems like eyed3 named package wasn't installed probably " + "Check back at the support tab in the main website. Or if you're " + "trying to close the application abruptly, keep pressing CTRL + C repeatedly.")) @staticmethod def get_abs_filename(filename): diff --git a/Stephanie/TextManager/text_manager.py b/Stephanie/TextManager/text_manager.py index 693e23a..f25536c 100644 --- a/Stephanie/TextManager/text_manager.py +++ b/Stephanie/TextManager/text_manager.py @@ -15,8 +15,8 @@ def get_speech_from_text(self, text): try: self.text_recognizer.recognize_from_google(text) except: - print("Some issue with google text to speech mechanism, change to some other service." - " Or just wait for some time mate, turning off and on do magic sometimes too.") + print(_("Some issue with google text to speech mechanism, change to some other service." + " Or just wait for some time mate, turning off and on do magic sometimes too.")) return self else: raise Exception("Man, did you mess up with tts_engine setting? Yes you did, don't lie to me" @@ -27,9 +27,9 @@ def save_speech_result(self): try: return self.text_recognizer.save_speech_from_google() except: - print("Look it shouldn't happen but since it happened, just get to support tab of main website mate," - " some issue with os is what I assume unless you haven't changed code if in that case" - "man, well.") + print(_("Look it shouldn't happen but since it happened, just get to support tab of main website mate," + " some issue with os is what I assume unless you haven't changed code if in that case" + "man, well.")) def speak_result(self, speech_result_filename): option = self.c.config['TTS']['tts_player'].lower() diff --git a/Stephanie/boot.py b/Stephanie/boot.py index e149a41..083471c 100644 --- a/Stephanie/boot.py +++ b/Stephanie/boot.py @@ -21,6 +21,9 @@ def __init__(self): def initiate(self): translations = gettext.translation('messages', localedir='Stephanie/locales', languages=[lang.get_code()]) translations.install() + print(_("INIT_MODULES...")) + self.c.init_modules() + print(_("MODULES_INIT")) print(_("Stephanie is on and loading, wait for the beep sound to give your command.")) if self.c.config.getboolean("APPLICATION", "update_check"): diff --git a/Stephanie/configurer.py b/Stephanie/configurer.py index eeca8a5..6276a64 100644 --- a/Stephanie/configurer.py +++ b/Stephanie/configurer.py @@ -5,23 +5,23 @@ class Configurer: def __init__(self, filename="config.ini", modules_filename="modules.json"): - print("initialised") self.abs_filename = self.get_abs_filename(filename) self.abs_mods_filename = self.get_abs_filename(modules_filename) self.config = configparser.ConfigParser() self.config.read(self.abs_filename) self.sections = self.config.sections() + + def init_modules(self): self.modules = self.retreive_modules(self.abs_mods_filename) @staticmethod def retreive_modules(abs_mods_filename): - print("modules retreived.") try: with open(abs_mods_filename, "r") as file: modules = json.load(file) file.close() except Exception as e: - raise Exception("Modules.json file has been not formatted correctly. check the support tab in case you're integrating some 3rd party module.") from e + raise Exception(_("Modules.json file has been not formatted correctly. check the support tab in case you're integrating some 3rd party module.")) from e return modules def get_modules(self, filename=None): diff --git a/Stephanie/updater.py b/Stephanie/updater.py index 5f587bf..a447b23 100644 --- a/Stephanie/updater.py +++ b/Stephanie/updater.py @@ -3,37 +3,39 @@ class Updater: - def __init__(self, speaker): - self.speaker = speaker - self.c = config - self.current_version = self.c.config.get("APPLICATION", "version") - self.update_url = "https://raw.githubusercontent.com/SlapBot/va-version-check/master/version.json" - self.requests = requests - self.data = None + def __init__(self, speaker): + self.speaker = speaker + self.c = config + self.current_version = self.c.config.get("APPLICATION", "version") + self.update_url = "https://raw.githubusercontent.com/SlapBot/va-version-check/master/version.json" + self.requests = requests + self.data = None - def check_for_update(self): - try: - self.data = self.get_update_information() - except Exception: - print("Couldn't access stephanie's version update information.") - return - try: - if str(self.current_version) != str(self.data['version']): - print("Your virtual assistant's version is %s, while the latest one is %s" % (self.current_version, self.data['version'])) - if int(self.data['print_status']): - print("Kindly visit the main website of stephanie at www.github.com/slapbot/stephanie-va to update the software to it's latest version.") - if int(self.data['speak_status']): - self.speaker.speak(self.data['message']) - for message in self.data['additional_information']: - print(message) - if self.data['speak_announcement']: - self.speaker.speak(self.data['speak_announcement']) - except Exception: - print("There's some problem in recieving version update information.") - return + def check_for_update(self): + try: + self.data = self.get_update_information() + except Exception: + print(_("updater.error.failed_request")) + return + try: + if str(self.current_version) != str(self.data['version']): + print(_("updater.notice.old_version").format( + self.current_version, + self.data['version']) + ) + if int(self.data['print_status']): + print(_("updater.notice.update_url")) + if int(self.data['speak_status']): + self.speaker.speak(self.data['message']) + for message in self.data['additional_information']: + print(message) + if self.data['speak_announcement']: + self.speaker.speak(self.data['speak_announcement']) + except Exception: + print(_("updater.error.failed_update")) + return - - def get_update_information(self): - r = self.requests.get(self.update_url) - data = r.json() - return data + def get_update_information(self): + r = self.requests.get(self.update_url) + data = r.json() + return data From 7e4f44ed449403c8533b0451be2762be606918e3 Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 24 Oct 2017 22:40:13 +0700 Subject: [PATCH 09/14] Removed command words from config ini --- config.ini | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config.ini b/config.ini index 93290dd..19ef489 100644 --- a/config.ini +++ b/config.ini @@ -65,11 +65,6 @@ open_weather_map_api_key = zomato_api_key = oauth_access_token = -[LOGS] -start_text = Give me your command! -listened_success_text = Processing command... -listened_error_text = I beg your pardon, could you repeat your command once again? - [CORE] speech_filename = speak.mp3 speech_directory = speeches From 501dd4ab4b2b0d32c3c3d1d4a402c6d34d387bbf Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 27 Oct 2017 16:59:00 +0700 Subject: [PATCH 10/14] Changed translation text ids --- Stephanie/Modules/alpha_search_module.py | 14 ++++---- Stephanie/Modules/evernote_module.py | 9 ++--- Stephanie/Modules/facebook_module.py | 29 ++++++---------- Stephanie/Modules/football_module.py | 18 +++++----- Stephanie/Modules/gmail_module.py | 17 +++++----- Stephanie/Modules/google_calendar_module.py | 8 ++--- Stephanie/Modules/movie_information_module.py | 12 +++---- Stephanie/Modules/reporter_module.py | 32 ++++++++--------- Stephanie/Modules/system_module.py | 34 +++++++++---------- Stephanie/Modules/twitter_module.py | 28 ++++++--------- Stephanie/Modules/weather_report_module.py | 20 +++++------ Stephanie/Modules/zomato_module.py | 31 ++++++++--------- Stephanie/configurer.py | 2 +- 13 files changed, 113 insertions(+), 141 deletions(-) diff --git a/Stephanie/Modules/alpha_search_module.py b/Stephanie/Modules/alpha_search_module.py index 48b2484..7b079e1 100644 --- a/Stephanie/Modules/alpha_search_module.py +++ b/Stephanie/Modules/alpha_search_module.py @@ -23,18 +23,18 @@ def do_a_search(self): elif raw_text_array[i] == "search": status = True if status is False: - return _("Can you possibly phrase it a bit better?") + return _("rephrase.ask") phrase = phrase.strip() try: text = self.client.search(phrase) except ConfidenceError: - return _("Sorry, I couldn't find what you asked for, maybe try being a little more specific.") + return _("error.search.no_results") except InternalError: - return _("It seems something is wrong with the wolframalpha search engine, maybe try asking later.") + return _("error.search.wolframalpha") except MissingTokenError: - return _("Seems you haven't provided the API TOKEN for search engine, please add it in config file.") - print(_("API TOKEN for wolframalpha search engine is missing, head in to docs to see how to properly fill the configurations for search engine.")) + return _("error.search.no_api_token") + print(_("error.search.wolframalpha.no_api_token")) except InvalidTokenError: - return _("Seems you haven't provided the API TOKEN or it's wrong for search engine, please add it in config file.") - print(_("API TOKEN for wolframalpha search engine is missing or is invalid, head in to docs to see how to properly fill the configurations for search engine.")) + return _("error.search.incorrect_api_token") + print(_("error.search.wolframalpha.incorrect_api_token")) return text diff --git a/Stephanie/Modules/evernote_module.py b/Stephanie/Modules/evernote_module.py index 9b4c7f6..023c764 100644 --- a/Stephanie/Modules/evernote_module.py +++ b/Stephanie/Modules/evernote_module.py @@ -33,15 +33,12 @@ def write_note(self): try: created_note = self.note_store.createNote(note) # Stores the new note in Evernote except: - response = (_("Note wasn't created successfully, you probably didn't spelled anything or spelled really " - "bad, Not my fault okay? It's never a program's fault.")) + response = (_("error.note.create")) print(response) return response if created_note: - return _("I successfully wrote down your note.") + return _("note.create.success") else: - response = (_("Note wasn't created successfully, you probably didn't spelled anything or spelled really " - "bad, Not my fault okay? It's never a program's fault. /s Refer back to docs.")) + response = (_("error.note.create")) print(response) return response - diff --git a/Stephanie/Modules/facebook_module.py b/Stephanie/Modules/facebook_module.py index ed8608c..fc1cc25 100644 --- a/Stephanie/Modules/facebook_module.py +++ b/Stephanie/Modules/facebook_module.py @@ -56,12 +56,10 @@ def get_birthday_reminders(self): results = self.graph.request("me/friends", args={'fields': 'id,name,birthday'}) except facebook.GraphAPIError: - response = (_("I have not been authorized to query your Facebook. If you " + - "would like to check birthdays in the future, please visit " + - "the Jasper dashboard.")) + response = (_("error.facebook.access.birthdays")) return response except: - return _("I apologize, there's a problem with that service at the moment.") + return _("error.service.unknown") needle = datetime.datetime.now(tz=pytz.utc).strftime("%m/%d") @@ -75,12 +73,11 @@ def get_birthday_reminders(self): if len(people) > 0: if len(people) == 1: - output = _("{0} has a birthday today.").format(people[0]) + output = _("birthday.friend.today").format(people[0]) else: - output = _("Your friends with birthdays today are ") + \ - ", ".join(people[:-1]) + _(" and ") + people[-1] + "." + output = _("birthday.friends.today") + ", ".join(people[:-1]) + _("join.and") + people[-1] + "." else: - output = _("None of your friends have birthdays today.") + output = _("birthday.none.today") return output @@ -100,21 +97,19 @@ def get_notifications(self): try: results = self.graph.request("me/notifications") except facebook.GraphAPIError: - response = (_("I have not been authorized to query your Facebook. If you " + - "would like to check your notifications in the future, " + - "please visit the Stephanie facebook module configuraton.")) + response = (_("error.facebook.access.notifications")) return response except: - return _("I apologize, there's a problem with that service at the moment.") + return _("error.service.unknown") if not len(results['data']): - return _("You have no Facebook notifications.") + return _("facebook.notifications.none") updates = [] for notification in results['data']: updates.append(notification['title']) count = len(results['data']) - response = (_("You have {0} Facebook notifications. ").format(str(count)) + " ".join(updates) + ". ") + response = (_("facebook.notifications").format(str(count)) + " ".join(updates) + ". ") return response @@ -125,9 +120,7 @@ def status_update(self): self.graph.put_wall_post(text) self.assistant.say("You have successully put up a wall post.") except facebook.GraphAPIError: - response = (_("I have not been authorized to query your Facebook. If you " + - "would like to check your notifications in the future, " + - "please visit the Stephanie facebook module configuraton.")) + response = (_("error.facebook.access.notifications")) return response except: - return _("I apologize, there's a problem with that service at the moment.") + return _("error.service.unknown") diff --git a/Stephanie/Modules/football_module.py b/Stephanie/Modules/football_module.py index 474244f..aa6fd3e 100644 --- a/Stephanie/Modules/football_module.py +++ b/Stephanie/Modules/football_module.py @@ -100,7 +100,7 @@ def league_specific_table(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def league_specific_next_fixtures(self): @@ -111,7 +111,7 @@ def league_specific_next_fixtures(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def league_specific_previous_fixtures(self): @@ -163,7 +163,7 @@ def team_previous_fixtures(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def league_specific_news(self): @@ -174,7 +174,7 @@ def league_specific_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def team_specific_news(self): @@ -185,7 +185,7 @@ def team_specific_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def team_news(self): @@ -196,7 +196,7 @@ def team_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def team_injury_news(self): @@ -207,7 +207,7 @@ def team_injury_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def team_transfer_talk(self): @@ -218,7 +218,7 @@ def team_transfer_talk(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False def get_news(self): @@ -229,5 +229,5 @@ def get_news(self): text = self.assistant.listen().decipher() if text.upper() in self.NEGATIVE: self.assistant.say("Alright then blimey.") - return _("Alright then blimey.") + return _("alright.blimey") return False diff --git a/Stephanie/Modules/gmail_module.py b/Stephanie/Modules/gmail_module.py index b983f2e..8639df5 100644 --- a/Stephanie/Modules/gmail_module.py +++ b/Stephanie/Modules/gmail_module.py @@ -22,8 +22,7 @@ def do_init(self): self.conn.debug = 0 self.conn.login(self.gmail_address, self.password) except: - response = _("Either your credentials are wrong mate, or there is some problem going on, do me a favor, I know " - "you won't but whatever, just inform me in the forums.") + response = _("error.gmail.access") print(response) return response @@ -113,25 +112,25 @@ def handle(self): num_unread, msgs = self.fetch_unread_emails(limit=5) if num_unread > 5: - response = _("You have {0} unread emails, out of which 5 latest ones are as follows, please wait a second, as I process").format(num_unread) + response = _("gmail.unread.latest").format(num_unread) self.assistant.say(response) senders = [] for e in msgs: senders.append(self.get_sender(e)) except imaplib.IMAP4.error: - return _("I'm sorry. I'm not authenticated to work with your Gmail.") + return _("error.gmail.authentication") if not senders: - return _("You have no unread emails.") + return _("gmail.unread.none") elif len(senders) == 1: - return _("You have one unread email from {0}.").format(senders[0]) + return _("gmail.unread.one").format(senders[0]) else: - response = _("You have {0} unread emails").format(len(senders)) + response = _("gmail.unread").format(len(senders)) unique_senders = list(set(senders)) if len(unique_senders) > 1: - response += _(". Senders include: ") + response += _("gmail.senders") response += '...'.join(senders) else: - response += _(" from ") + unique_senders[0] + response += _("join.from") + unique_senders[0] return response diff --git a/Stephanie/Modules/google_calendar_module.py b/Stephanie/Modules/google_calendar_module.py index 2bad758..b8e575e 100644 --- a/Stephanie/Modules/google_calendar_module.py +++ b/Stephanie/Modules/google_calendar_module.py @@ -121,7 +121,7 @@ def add_event(self): user_response = self.assistant.listen().decipher() if bool(re.search('Yes', user_response, re.IGNORECASE)): - return _("Okay, I added it to your calendar") + return _("calendar.add.successful") self.service.events().delete(calendarId='primary', eventId=created_event['id']).execute() @@ -151,7 +151,7 @@ def get_events_today(self): timeMin=today_start_time, timeMax=today_end_time).execute() if len(events_found['items']) == 0: - return _("You have no events scheduled for today") + return _("calendar.events.today.none") for event_found in events_found['items']: @@ -217,7 +217,7 @@ def get_events_tomorrow(self): timeMax=tomorrow_end_time ).execute() if len(events['items']) == 0: - return _("You have no events scheduled Tomorrow") + return _("calendar.events.tomorrow.none") for event in events['items']: @@ -250,4 +250,4 @@ def get_events_tomorrow(self): page_token = events.get('nextPageToken') if not page_token: - return _("That's it.") + return _("complete") diff --git a/Stephanie/Modules/movie_information_module.py b/Stephanie/Modules/movie_information_module.py index 5966bd9..c37452e 100644 --- a/Stephanie/Modules/movie_information_module.py +++ b/Stephanie/Modules/movie_information_module.py @@ -14,28 +14,26 @@ def give_some_information(self): movies.sort(key=lambda x: x.year, reverse=True) for i in range(0, len(movies)): if i == 0: - speech = _("Is the movie you're referring to {0}, released in {1}").format( + speech = _("movie.ask_confirmation").format( movies[i].title, movies[i].year) else: - speech = _("Alright, then how about {0}, released in {1}").format( + speech = _("movie.suggest").format( movies[i].title, movies[i].year) self.assistant.say(speech) response = self.assistant.listen().decipher() if len(response.split()) > 3: - return _("Alright dude, you are kind of moody.") + return _("movie.moody") elif response == "yes": imdb_id = movies[i].imdb_id print(_("found")) return self.give_movie_information_from_imdb_id(imdb_id) else: - return _("Sorry, but your pronounciation is awful. Try again") + return _("movie.ask_repeat") @staticmethod def give_movie_information_from_imdb_id(imdb_id): movie = omdb.imdbid(imdb_id) - speech = _("{0} was released in {1}, directed by {2} of genre {3}" - "has a runtime of about {4} garnered a rating of {5} " - "featuring {6} had a plot such as {7}").format( + speech = _("movie.report").format( movie.title, movie.released, movie.director, diff --git a/Stephanie/Modules/reporter_module.py b/Stephanie/Modules/reporter_module.py index f35951a..840a0f3 100644 --- a/Stephanie/Modules/reporter_module.py +++ b/Stephanie/Modules/reporter_module.py @@ -15,7 +15,7 @@ def __init__(self, *args): self.articles = Articles(self.API_KEY) self.sources = Sources(self.API_KEY) else: - print(_("Kindly look back at the documentation to configure news module properly especially the API keys.")) + print(_("error.news.configuration")) return False self.sources_url = {} self.sources.information() @@ -38,40 +38,37 @@ def all_sources(self): return self.sources_url def get_news(self): - self.assistant.say(_("Would you prefer any specific category? If yes then what would it be?")) + self.assistant.say(_("news.category.ask")) category_status = self.assistant.listen().decipher() if category_status.upper() in self.NEGATIVE: category = False else: categories = self.get_all_categories() category = self.search(categories, category_status) - self.assistant.say(_("Any preference you would like to have about source of your news? like CNN" - "or Time magazine or maybe The hindu?")) + self.assistant.say(_("news.sources.ask")) source_status = self.assistant.listen().decipher() if source_status.upper() in self.NEGATIVE: source = False else: if category: sources_available = self.get_by_category(category) - response = _("Out of all the sources as follows") + response = _("news.sources.list") for source_name, source_url in sources_available.items(): response += " %s," % source_name - response += _(", which one would you like to pick?") + response += _("news.sources.select") self.assistant.say(response) source_command = self.assistant.listen().decipher() source = self.search(list(sources_available), source_command) else: - self.assistant.say(_("So would you want me to list all the sources around 70 which to be" - "honest would be a hefty task, so if not, then just let me know of" - "your source name and I would let you know if it's available or not.")) + self.assistant.say(_("news.sources.all.ask")) all_sources_status = self.assistant.listen().decipher() sources_available = self.all_sources() if all_sources_status.upper() in self.AFFIRMATIVE: - response = _("Good job, lazy ass, so here are all the available sources as follows ") + response = _("news.sources.all.ask") sources_available_list = list(sources_available) for source_name in sources_available_list: response += " %s," % source_name - response += _(", which one would you like to pick?)" + response += _("news.sources.select") self.assistant.say(response) source_command = self.assistant.listen().decipher() all_sources_status = source_command @@ -83,9 +80,9 @@ def get_news(self): sort_by = sort_bys_available[0] else: if len(sort_bys_available) == 2: - response = _("And what kind of news sort would you like? {0} or {1}?").format(sort_bys_available[0], sort_bys_available[1]) + response = _("news.sort.two_options").format(sort_bys_available[0], sort_bys_available[1]) else: - response = _("And what kind of news sort would you like? {0} or {1}, or maybe {2}?").format( + response = _("news.sort.three_options").format( sort_bys_available[0], sort_bys_available[1], sort_bys_available[2], @@ -94,8 +91,7 @@ def get_news(self): sort_by_command = self.assistant.listen().decipher() sort_by = self.search(sort_bys_available, sort_by_command) else: - self.assistant.say(_("And what kind of news sort would you like?" - "latest or maybe top ones shown in front page?")) + self.assistant.say(_("news.sort.described_options")) sort_status_command = self.assistant.listen().decipher() sort_by = self.search(['top', 'popular' 'latest'], sort_status_command) if not source: @@ -119,15 +115,15 @@ def get_response(self, source, sort_by=None, threshold=5): source = source.lower().replace(" ", "-") articles = self.articles.get(source, sort_by=sort_by).articles articles = articles[:threshold] - response = _("So the {0} news from {1} news source are as follows ").format(sort_by, source) + response = _("news.report").format(sort_by, source) for article in articles: if article['title']: response += "%s, " % article['title'] if article['description']: response += "%s, " % article['description'] if article['author']: - response += _("was reported by {0}.").format(article['author']) - response += _("and in the other news. ") + response += _("news.report.by").format(article['author']) + response += _("news.report.continue") return response @staticmethod diff --git a/Stephanie/Modules/system_module.py b/Stephanie/Modules/system_module.py index 22d1d99..7210637 100644 --- a/Stephanie/Modules/system_module.py +++ b/Stephanie/Modules/system_module.py @@ -9,10 +9,10 @@ def __init__(self, *args): self.gender = self.get_configuration(section="USER", key="gender") def default(self): - return _("Repeat back your command!.") + return _("command.ask_repeat") def meaning_of_life(self): - return _("42 is the meaning of life.") + return _("life.meaning") def time_right_now(self): t = dt.datetime.now() @@ -27,11 +27,11 @@ def wake_up(self): if self.gender: gender = self.gender.lower() if gender == "male": - return _("{0}, sir!").format(self.phase_of_the_day(t)) + return _("greeting.sir").format(self.phase_of_the_day(t)) elif gender == "female": - return _("{0}, mam!").format(self.phase_of_the_day(t)) + return _("greeting.mam").format(self.phase_of_the_day(t)) else: - return _("{0}, dear!").format(self.phase_of_the_day(t)) + return _("greeting.dear").format(self.phase_of_the_day(t)) elif self.name: return "{0}, {1}!".format(self.phase_of_the_day(t), self.name) else: @@ -44,11 +44,11 @@ def wake_up(self): def go_to_sleep(self): self.assistant.events.add("sleep").trigger("sleep") - return _("Sleep for the weak!") + return _("system.sleep") def quit(self): self.assistant.events.add("quit").trigger("quit") - return _("I will come back stronger!") + return _("system.quit") def tell_system_status(self): import psutil @@ -63,12 +63,12 @@ def tell_system_status(self): disk_percent = psutil.disk_usage('/')[3] boot_time = datetime.datetime.fromtimestamp(psutil.boot_time()) running_since = boot_time.strftime("%A %d. %B %Y") - response = _("I am currently running on {0} version {1}. ").format(os, version) - response += _("This system is named {0} and has {1} CPU cores. ").format(name, cores) - response += _("Current disk_percent is {0} percent. ").format(disk_percent) - response += _("Current CPU utilization is {0} percent. ").format(cpu_percent) - response += _("Current memory utilization is {0} percent. ").format(memory_percent) - response += _("it's running since {0}.").format(running_since) + response = _("system.version").format(os, version) + response += _("system.name").format(name, cores) + response += _("system.disk_percent").format(disk_percent) + response += _("system.cpu").format(cpu_percent) + response += _("system.memory").format(memory_percent) + response += _("system.running_since").format(running_since) return response @staticmethod @@ -108,7 +108,7 @@ def time_teller(time): # hour = d[hour] # minute = d[minute] - return _("The time is {0} {1} {2}").format(hour, minute, phase) + return _("time.now").format(hour, minute, phase) # # hour = d[int(t[0:2])] if t[0:2] != "00" else d[12] # # suffix = 'a.m.' if d[int(t[7:9])] == hour else 'p.m.' @@ -131,8 +131,8 @@ def date_teller(date): def phase_of_the_day(time): hour = time.hour if hour < 12: - return _('Good Morning') + return _('greeting.morning') elif 12 <= hour < 18: - return _('Good Afternoon') + return _('greeting.afternoon') if hour > 6: - return _('Good Evening') + return _('greeting.evening') diff --git a/Stephanie/Modules/twitter_module.py b/Stephanie/Modules/twitter_module.py index 400f7f5..e8789a0 100644 --- a/Stephanie/Modules/twitter_module.py +++ b/Stephanie/Modules/twitter_module.py @@ -39,13 +39,13 @@ def get_trending(self): name = trend['name'] # Grabs name of each trend if name.startswith('#'): self.assistant.say(name) # Only grabs hashtags - return _("these were the top 5 trends on twitter globally.") + return _("twitter.trends.top") def status_update(self): - self.assistant.say(_("What would you like to tweet?")) + self.assistant.say(_("twitter.tweet.ask")) tweet = self.assistant.listen().decipher() self.api.update_status(tweet) - return _("{0} has been tweeted").format(tweet) + return _("twitter.tweet.successful").format(tweet) def get_notifications(self): latest_retweets = [] @@ -72,28 +72,20 @@ def get_notifications(self): # latest_direct_messages_id.append(directMessage.id) response = "" if len(latest_retweets) > 0: - response += _("Latest Retweets are ") + response += _("twitter.retweets") for retweetFinal in latest_retweets: - response += (retweetFinal.text + _(" by ") + retweetFinal.user.screen_name + ". ") + response += (retweetFinal.text + _("join.by") + retweetFinal.user.screen_name + ". ") else: - response += _("You have no re-tweets. ") + response += _("twitter.retweets.none") if len(latest_mentions) > 0: - response += _("Latest Mentions are ") + response += _("twitter.mentions.latest") for mentionFinal in latest_mentions: - response += (mentionFinal.text + _(" from ") + mentionFinal.user.screen_name + ". ") + response += (mentionFinal.text + _("join.from") + mentionFinal.user.screen_name + ". ") else: - response += _("You have no mentions. ") + response += _("twitter.mentions.none") - # if len(latest_direct_messages) > 0: - # self.assistant.say("Latest Direct Messages are") - # - # for directMessageFinal in latest_direct_messages: - # self.assistant.say(directMessageFinal.text + " from " + directMessageFinal.user.screen_name) - # - # else: - # self.assistant.say("You have no Direct Messages") - response += _("These were the latest notifications.") + response += _("twitter.notifications.latest") return response diff --git a/Stephanie/Modules/weather_report_module.py b/Stephanie/Modules/weather_report_module.py index 6109681..c1c0279 100644 --- a/Stephanie/Modules/weather_report_module.py +++ b/Stephanie/Modules/weather_report_module.py @@ -65,22 +65,22 @@ def get_weather_report(self, weather, loc, temp_unit='celsius', report='current' temp_max = self.num_service.parseMagnitude(temp['temp_max']) temp_min = self.num_service.parseMagnitude(temp['temp_min']) curr_temp = self.num_service.parseMagnitude(temp['temp']) - weather_report = _("Weather at {0}. Today is {1}. There is a chance of {2}. Now Temperature is {3} degree {4}. Humidity {5} percent. Wind Speed {6} with cloud cover {7} percent.").format(loc, stat, detstat, curr_temp, temp_unit, humi, wind_speed, clou); + weather_report = _("weather.today").format(loc, stat, detstat, curr_temp, temp_unit, humi, wind_speed, clou); elif report == 'tomorrow': temp = weather.get_temperature(temp_unit) temp_morn = self.num_service.parseMagnitude(temp['morn']) temp_day = self.num_service.parseMagnitude(temp['day']) temp_night = self.num_service.parseMagnitude(temp['night']) - weather_report = _("Weather at {0}. Tomorrow will be {1}. There will be a chance of {2}. Temperature in the morning {3} degree {4}. Days Temperature will be {5} degree {4}. and Temperature at night will be {6} degree {4}. Humidity {7} percent. Wind Speed {8} with clouds cover {9} percent.").format(loc, stat, destat, temp_morn, temp_unit, temp_day, temp_night, humi, wind_speed, clou) + weather_report = _("weather.tomorrow").format(loc, stat, destat, temp_morn, temp_unit, temp_day, temp_night, humi, wind_speed, clou) return weather_report def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report='current'): - weather_report = _("Weather forecast for next week at {0}. ").format(loc) + weather_report = _("weather.next_week").format(loc) rainy_days = len(forecast.when_rain()) if rainy_days > 0: - rainy_days_str = _("Rainy Days are ") + rainy_days_str = _("weather.rain.days") for d in range(rainy_days): rain_day = forecast.when_rain()[d].get_reference_time() date_str = self.format_time_stamp(rain_day) @@ -91,7 +91,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_rainy = forecast.most_rainy() if most_rainy: - weather_report += _("You will observe heavy rain on ") + weather_report += _("weather.rain.most") ref_time = most_rainy.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -99,7 +99,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' sunny_days = len(forecast.when_sun()) if sunny_days > 0: - sunny_days_str = _("Sunny Days are ") + sunny_days_str = _("weather.sun.days") for d in range(sunny_days): sunny_day = forecast.when_sun()[d].get_reference_time() date_str = self.format_time_stamp(sunny_day) @@ -110,7 +110,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_hot = forecast.most_hot() if most_hot: - weather_report += _("You will feel heat on ") + weather_report += _("weather.sun.most") ref_time = most_hot.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -118,7 +118,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_windy = forecast.most_windy() if most_windy: - weather_report += _("Most windy day will be ") + weather_report += _("weather.wind.day") ref_time = most_windy.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -126,7 +126,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_humid = forecast.most_humid() if most_humid: - weather_report += _("Most humid day will be ") + weather_report += _("weather.humid.day") ref_time = most_humid.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " @@ -134,7 +134,7 @@ def get_weather_report_weekly(self, forecast, loc, temp_unit='celsius', report=' most_cold = forecast.most_cold() if most_cold: - weather_report += _("Coolest day will be ") + weather_report += _("weather.cold.day") ref_time = most_cold.get_reference_time() date_str = self.format_time_stamp(ref_time) weather_report += date_str + ". " diff --git a/Stephanie/Modules/zomato_module.py b/Stephanie/Modules/zomato_module.py index 2c7785d..507d699 100644 --- a/Stephanie/Modules/zomato_module.py +++ b/Stephanie/Modules/zomato_module.py @@ -16,27 +16,24 @@ def __init__(self, *args): def handle(self): status = self.z.set_location(self.city) if not status: - return _("Your api key wasn't provided or maybe your city isn't available.") + return _("error.zomato.missing_info") rests = self.z.get_location_details() if not rests: - return _("No good places to eat found nearby your location.") + return _("restaurant.recommendation.none") for rest in rests: rest = rest['restaurant'] - self.assistant.say(_("{0} situated nearby {1} is found, it offers cuisines like {2} " - "with an average price range of {3} {4} per person, and over {5} people have" - "rated this place with an average ratings as{6}. " - "So would you like to order this place?").format( - rest['name'], - rest['location']['locality'], - rest['cuisines'], - rest['currency'], - round(rest['average_cost_for_two'] / 2), - rest['user_rating']['votes'], - rest['user_rating']['aggregate_rating'] - )) + self.assistant.say(_("restaurant.recommendation").format( + rest['name'], + rest['location']['locality'], + rest['cuisines'], + rest['currency'], + round(rest['average_cost_for_two'] / 2), + rest['user_rating']['votes'], + rest['user_rating']['aggregate_rating'] + )) text = self.assistant.listen().decipher() if text.upper() in self.AFFIRMATIVE: webbrowser.open(rest['url']) - return _("Thank you.") - self.assistant.say(_("okay, then how about this one? ")) - return _("That's all the restaurants available near your location.") + return _("thanks") + self.assistant.say(_("restaurant.recommendation.alternative")) + return _("restaurant.recommendation.complete") diff --git a/Stephanie/configurer.py b/Stephanie/configurer.py index 6276a64..082a300 100644 --- a/Stephanie/configurer.py +++ b/Stephanie/configurer.py @@ -21,7 +21,7 @@ def retreive_modules(abs_mods_filename): modules = json.load(file) file.close() except Exception as e: - raise Exception(_("Modules.json file has been not formatted correctly. check the support tab in case you're integrating some 3rd party module.")) from e + raise Exception(_("error.format_modules_file")) from e return modules def get_modules(self, filename=None): From bc18862da7c40dcfff006cdbdbe90b63382941d6 Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 27 Oct 2017 19:33:52 +0700 Subject: [PATCH 11/14] Changed translation text ids --- Stephanie/EventDispatcher/event_dispatcher.py | 4 ++-- Stephanie/Modules/base_module.py | 7 ++----- Stephanie/Modules/wikipedia_module.py | 6 +++--- Stephanie/TextManager/speaker.py | 9 ++++----- Stephanie/TextManager/text_manager.py | 7 ++----- Stephanie/boot.py | 12 ++++++++---- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Stephanie/EventDispatcher/event_dispatcher.py b/Stephanie/EventDispatcher/event_dispatcher.py index dc1fbd2..49e577b 100644 --- a/Stephanie/EventDispatcher/event_dispatcher.py +++ b/Stephanie/EventDispatcher/event_dispatcher.py @@ -12,12 +12,12 @@ def close(self): def sleep(self, sender): self.sleep_status = True - print(_("The virtual assistant is going to sleep by {0} method").format(sender)) + print(_("virtual_assistant.sleep").format(sender)) return self def quit(self, sender): self.active_status = True - print(_("The virtual assistant is being quit by {0} method").format(sender)) + print(_("virtual_assistant.quit").format(sender)) def add(self, handle_name): handle_event = getattr(self, handle_name) diff --git a/Stephanie/Modules/base_module.py b/Stephanie/Modules/base_module.py index 577856f..b2dcc14 100644 --- a/Stephanie/Modules/base_module.py +++ b/Stephanie/Modules/base_module.py @@ -15,14 +15,11 @@ def get_configuration(self, key, section="MODULES"): try: value = self.config[section][key] except KeyError: - print(_("API KEYS FOR {0} is not provided in the config.ini file." - " Refer back to the docs, or just add the goddamn key.").format(key)) + print(_("error.no_api_keys").format(key)) return False if value: return value - print(_("The correct API KEY wasn't provided or wasn't provided at all for {0}, what the ... okay man" - " now look back at docs to find how to do that, is pretty simple just one line long. " - "Lazy ass").format(key)) + print(_("error.incorrect_api_keys").format(key)) return False def write_configuration(self, key, value, section="MODULES"): diff --git a/Stephanie/Modules/wikipedia_module.py b/Stephanie/Modules/wikipedia_module.py index aa12a04..6675386 100644 --- a/Stephanie/Modules/wikipedia_module.py +++ b/Stephanie/Modules/wikipedia_module.py @@ -11,7 +11,7 @@ def __init__(self, *args): def give_a_summary(self): # Translate this \/ - self.assistant.say(_("What would you like to know about?")) + self.assistant.say(_("encyclopedia.search.ask")) text = self.assistant.listen().decipher() # add beep sound text = text.strip().replace(" ", "%20") @@ -33,11 +33,11 @@ def give_a_summary(self): return final else: # Translate this \/ - self.assistant.say(_("Sorry, I couldn't find any article with that title. :sadface:")) + self.assistant.say(_("encyclopedia.search.no_results")) return None # handle final being None if the page wasn't found return final except URLError: - return _("Unable to search your given query.") + return _("error.encyclopedia.search") diff --git a/Stephanie/TextManager/speaker.py b/Stephanie/TextManager/speaker.py index d46ba81..f7fd328 100644 --- a/Stephanie/TextManager/speaker.py +++ b/Stephanie/TextManager/speaker.py @@ -4,6 +4,7 @@ from pygame import mixer import platform + class Speaker: def __init__(self): self.speak_result = "" @@ -23,13 +24,11 @@ def speak_from_os(self, speech_result_filename): else: os.system(self.speak_result) except: - print(_("Default Audio Player for mp3 files is not set up, like vlc or something.")) + print(_("error.speaker.default")) try: self.hibernate() except: - print(_("Seems like eyed3 named package wasn't installed probably " - "Check back at the support tab in the main website. Or if you're " - "trying to close the application abruptly, keep pressing CTRL + C repeatedly.")) + print(_("error.eyed3_package.unknown")) @staticmethod def get_abs_filename(filename): @@ -40,7 +39,7 @@ def get_abs_filename(filename): def hibernate(self): self.audio_file = eyed3.load(self.speak_result) wait_period = self.audio_file.info.time_secs - time.sleep(wait_period+2) + time.sleep(wait_period + 2) def say(self, speech): self.speak_from_os(speech) diff --git a/Stephanie/TextManager/text_manager.py b/Stephanie/TextManager/text_manager.py index f25536c..1b9cb32 100644 --- a/Stephanie/TextManager/text_manager.py +++ b/Stephanie/TextManager/text_manager.py @@ -15,8 +15,7 @@ def get_speech_from_text(self, text): try: self.text_recognizer.recognize_from_google(text) except: - print(_("Some issue with google text to speech mechanism, change to some other service." - " Or just wait for some time mate, turning off and on do magic sometimes too.")) + print(_("error.google_text.unknown")) return self else: raise Exception("Man, did you mess up with tts_engine setting? Yes you did, don't lie to me" @@ -27,9 +26,7 @@ def save_speech_result(self): try: return self.text_recognizer.save_speech_from_google() except: - print(_("Look it shouldn't happen but since it happened, just get to support tab of main website mate," - " some issue with os is what I assume unless you haven't changed code if in that case" - "man, well.")) + print(_("error.google_text.save")) def speak_result(self, speech_result_filename): option = self.c.config['TTS']['tts_player'].lower() diff --git a/Stephanie/boot.py b/Stephanie/boot.py index 083471c..35de566 100644 --- a/Stephanie/boot.py +++ b/Stephanie/boot.py @@ -19,13 +19,17 @@ def __init__(self): self.updater = Updater(self.speaker) def initiate(self): - translations = gettext.translation('messages', localedir='Stephanie/locales', languages=[lang.get_code()]) + translations = gettext.translation( + 'messages', + localedir='Stephanie/locales', + languages=[lang.get_code()] + ) translations.install() - print(_("INIT_MODULES...")) + print(_("modules.init.start")) self.c.init_modules() - print(_("MODULES_INIT")) + print(_("modules.init.complete")) - print(_("Stephanie is on and loading, wait for the beep sound to give your command.")) + print(_("stephanie.ready")) if self.c.config.getboolean("APPLICATION", "update_check"): self.updater.check_for_update() self.status = True From 55fb4d08f2128caebb815f0b6bb987ab79274093 Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 27 Oct 2017 19:35:15 +0700 Subject: [PATCH 12/14] Updated english translations --- Stephanie/locales/en/LC_MESSAGES/messages.po | 652 ++++++++++++++++--- 1 file changed, 574 insertions(+), 78 deletions(-) diff --git a/Stephanie/locales/en/LC_MESSAGES/messages.po b/Stephanie/locales/en/LC_MESSAGES/messages.po index 11df53b..928279a 100644 --- a/Stephanie/locales/en/LC_MESSAGES/messages.po +++ b/Stephanie/locales/en/LC_MESSAGES/messages.po @@ -3,116 +3,612 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#: src/link/to/my/src:67 -msgid "" -msgstr "" -"Project-Id-Version: xxx\n" +"Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-07-06 12:31-0500\n" -"PO-Revision-Date: 2011-05-27 22:37+0100\n" -"Last-Translator: My NAME\n" -"Language-Team: TEAM \n" +"POT-Creation-Date: 2017-10-22 14:11+0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" +"Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: Stephanie/boot.py:25 -msgid "Stephanie is on and loading, wait for the beep sound to give your command." -msgstr "English Version: Stephanie is on and loading, wait for the beep sound to give your command." +#: Stephanie/updater.py:18 +msgid "error.update.failed_request" +msgstr "Couldn't access stephanie's version update information." -#: Stephanie/AudioManager/audio_recognizer.py:16 -msgid "sphinx_audio_understood" -msgstr "English Version: sphinx_audio_understood" +#: Stephanie/updater.py:22 +#, python-brace-format +msgid "update.old_version" +msgstr "Your virtual assistant's version is {0}, while the latest one is {1}" -#: Stephanie/AudioManager/audio_recognizer.py:19 -msgid "Sphinx could not understand audio" -msgstr "English Version: Sphinx could not understand audio" +#: Stephanie/updater.py:24 +msgid "update.url" +msgstr "" +"Kindly visit the main website of stephanie at www.github.com/slapbot/" +"stephanie-va to update the software to it's latest version." -#: Stephanie/AudioManager/audio_recognizer.py:22 -msgid "Sphinx error; {0}" -msgstr "English Version: Sphinx error; {0}" +#: Stephanie/updater.py:32 +msgid "error.update.failed_process" +msgstr "There's some problem in recieving version update information." -#: Stephanie/AudioManager/audio_recognizer.py:31 -msgid "Google Speech Recognition thinks you said " -msgstr "English Version: Google Speech Recognition thinks you said " +#: Stephanie/AudioManager/audio_getter.py:17 +msgid "command.ask" +msgstr "Give me your command!" -#: Stephanie/AudioManager/audio_recognizer.py:34 -msgid "Google Recognition couldn't understand your audio with enough confidence." -msgstr "English Version: Google Recognition couldn't understand your audio with enough confidence." +#: Stephanie/AudioManager/audio_getter.py:28 +msgid "command.processing" +msgstr "Processing command..." + +#: Stephanie/AudioManager/audio_getter.py:39 +#: Stephanie/Modules/system_module.py:12 +msgid "command.ask_repeat" +msgstr "I beg your pardon, could you repeat your command once again?" + +#: Stephanie/AudioManager/audio_recognizer.py:16 +#: Stephanie/AudioManager/audio_recognizer.py:31 +#: Stephanie/AudioManager/audio_recognizer.py:52 +#: Stephanie/AudioManager/audio_recognizer.py:71 +#: Stephanie/AudioManager/audio_recognizer.py:90 +#: Stephanie/AudioManager/audio_recognizer.py:112 +#: Stephanie/AudioManager/audio_recognizer.py:134 +#, python-brace-format +msgid "audio.repeat_input" +msgstr "{0} thinks you said " +#: Stephanie/AudioManager/audio_recognizer.py:19 #: Stephanie/AudioManager/audio_recognizer.py:36 -msgid "Google Speech Recognition could not understand audio" -msgstr "English Version: Google Speech Recognition could not understand audio" +#: Stephanie/AudioManager/audio_recognizer.py:55 +#: Stephanie/AudioManager/audio_recognizer.py:74 +#: Stephanie/AudioManager/audio_recognizer.py:93 +#: Stephanie/AudioManager/audio_recognizer.py:115 +#: Stephanie/AudioManager/audio_recognizer.py:137 +#, python-brace-format +msgid "error.audio.failed_understand" +msgstr "{0} could not understand audio" +#: Stephanie/AudioManager/audio_recognizer.py:22 #: Stephanie/AudioManager/audio_recognizer.py:39 -msgid "Could not request results from Google Speech Recognition service; {0}" -msgstr "English Version: Could not request results from Google Speech Recognition service; {0}" +#: Stephanie/AudioManager/audio_recognizer.py:58 +#: Stephanie/AudioManager/audio_recognizer.py:77 +#: Stephanie/AudioManager/audio_recognizer.py:96 +#: Stephanie/AudioManager/audio_recognizer.py:118 +#: Stephanie/AudioManager/audio_recognizer.py:140 +#, python-brace-format +msgid "error.audio.failed_request_service" +msgstr "Could not request results from {0} service; {1}" + +#: Stephanie/AudioManager/audio_recognizer.py:34 +msgid "error.audio.google_recognition.failed_understand" +msgstr "Google Recognition couldn't understand your audio with enough confidence." #: Stephanie/AudioManager/audio_recognizer.py:47 #: Stephanie/AudioManager/audio_recognizer.py:67 #: Stephanie/AudioManager/audio_recognizer.py:86 #: Stephanie/AudioManager/audio_recognizer.py:107 #: Stephanie/AudioManager/audio_recognizer.py:129 -msgid "Api key not found in the config.ini file." -msgstr "English Version: Api key not found in the config.ini file." +msgid "error.missing_api_key" +msgstr "Api key not found in the config.ini file." -#: Stephanie/AudioManager/audio_recognizer.py:52 -msgid "Google Cloud Speech thinks you said " -msgstr "English Version: Google Cloud Speech thinks you said" +#: Stephanie/configurer.py:24 +msgid "error.format_modules_file" +msgstr "" +"Modules.json file has been not formatted correctly. check the support tab in " +"case you're integrating some 3rd party module." -#: Stephanie/AudioManager/audio_recognizer.py:55 -msgid "Google Cloud Speech could not understand audio" -msgstr "English Version: Google Cloud Speech could not understand audio" +#: Stephanie/Modules/facebook_module.py:59 +msgid "error.facebook.access.birthdays" +msgstr "" +"I have not been authorized to query your Facebook. If you would like to " +"check birthdays in the future, please visit the Jasper dashboard." -#: Stephanie/AudioManager/audio_recognizer.py:58 -msgid "Could not request results from Google Cloud Speech service; {0}" -msgstr "English Version: Could not request results from Google Cloud Speech service; {0}" +#: Stephanie/Modules/facebook_module.py:64 +#: Stephanie/Modules/facebook_module.py:108 +#: Stephanie/Modules/facebook_module.py:133 +msgid "error.service.unknown" +msgstr "I apologize, there's a problem with that service at the moment." -#: Stephanie/AudioManager/audio_recognizer.py:71 -msgid "Wit.ai thinks you said " -msgstr "English Version: Wit.ai thinks you said " +#: Stephanie/Modules/facebook_module.py:78 +#, python-brace-format +msgid "birthday.friend.today" +msgstr "{0} has a birthday today." -#: Stephanie/AudioManager/audio_recognizer.py:74 -msgid "Wit.ai could not understand audio" -msgstr "English Version: Wit.ai could not understand audio" +#: Stephanie/Modules/facebook_module.py:80 +msgid "birthday.friends.today" +msgstr "Your friends with birthdays today are " -#: Stephanie/AudioManager/audio_recognizer.py:77 -msgid "Could not request results from Wit.ai service; {0}" -msgstr "English Version: Could not request results from Wit.ai service; {0}" +#: Stephanie/Modules/facebook_module.py:81 +msgid "join.and" +msgstr " and " -#: Stephanie/AudioManager/audio_recognizer.py:90 -msgid "Microsoft Bing Voice Recognition thinks you said " -msgstr "English Version: Microsoft Bing Voice Recognition thinks you said" +#: Stephanie/Modules/facebook_module.py:83 +msgid "birthday.none.today" +msgstr "None of your friends have birthdays today." -#: Stephanie/AudioManager/audio_recognizer.py:93 -msgid "Microsoft Bing Voice Recognition could not understand audio" -msgstr "English Version: Microsoft Bing Voice Recognition could not understand audio" +#: Stephanie/Modules/facebook_module.py:103 +#: Stephanie/Modules/facebook_module.py:128 +msgid "error.facebook.access.notifications" +msgstr "" +"I have not been authorized to query your Facebook. If you would like to " +"check your notifications in the future, please visit the Stephanie facebook " +"module configuraton." -#: Stephanie/AudioManager/audio_recognizer.py:96 -msgid "Could not request results from Microsoft Bing Voice Recognition service; {0}" -msgstr "English Version: Could not request results from Microsoft Bing Voice Recognition service; {0}" +#: Stephanie/Modules/facebook_module.py:110 +msgid "facebook.notifications.none" +msgstr "You have no Facebook notifications." -#: Stephanie/AudioManager/audio_recognizer.py:112 -msgid "Houndify thinks you said " -msgstr "English Version: Houndify thinks you said " +#: Stephanie/Modules/facebook_module.py:117 +#, python-brace-format +msgid "facebook.notifications" +msgstr "You have {0} Facebook notifications. " -#: Stephanie/AudioManager/audio_recognizer.py:115 -msgid "Houndify could not understand audio" -msgstr "English Version: Houndify could not understand audio" +#: Stephanie/Modules/gmail_module.py:25 +msgid "error.gmail.access" +msgstr "" +"Either your credentials are wrong mate, or there is some problem going on, " +"do me a favor, I know you won't but whatever, just inform me in the forums." -#: Stephanie/AudioManager/audio_recognizer.py:118 -msgid "Could not request results from Houndify service; {0}" -msgstr "English Version: Could not request results from Houndify service; {0}" +#: Stephanie/Modules/gmail_module.py:116 +#, python-brace-format +msgid "gmail.unread.latest" +msgstr "" +"You have {0} unread emails, out of which 5 latest ones are as follows, " +"please wait a second, as I process" -#: Stephanie/AudioManager/audio_recognizer.py:134 -msgid "IBM Speech to Text thinks you said " -msgstr "English Version: IBM Speech to Text thinks you said " +#: Stephanie/Modules/gmail_module.py:122 +msgid "error.gmail.authentication" +msgstr "I'm sorry. I'm not authenticated to work with your Gmail." -#: Stephanie/AudioManager/audio_recognizer.py:137 -msgid "IBM Speech to Text could not understand audio" -msgstr "English Version: IBM Speech to Text could not understand audio" +#: Stephanie/Modules/gmail_module.py:125 +msgid "gmail.unread.none" +msgstr "You have no unread emails." -#: Stephanie/AudioManager/audio_recognizer.py:140 -msgid "Could not request results from IBM Speech to Text service; {0}" -msgstr "English Version: Could not request results from IBM Speech to Text service; {0}" +#: Stephanie/Modules/gmail_module.py:127 +#, python-brace-format +msgid "gmail.unread.one" +msgstr "You have one unread email from {0}." + +#: Stephanie/Modules/gmail_module.py:129 +#, python-brace-format +msgid "gmail.unread" +msgstr "You have {0} unread emails" + +#: Stephanie/Modules/gmail_module.py:132 +msgid "gmail.senders" +msgstr ". Senders include: " + +#: Stephanie/Modules/gmail_module.py:135 Stephanie/Modules/twitter_module.py:85 +msgid "join.from" +msgstr " from " + +#: Stephanie/Modules/reporter_module.py:18 +msgid "error.news.configuration" +msgstr "" +"Kindly look back at the documentation to configure news module properly " +"especially the API keys." + +#: Stephanie/Modules/reporter_module.py:41 +msgid "news.category.ask" +msgstr "Would you prefer any specific category? If yes then what would it be?" + +#: Stephanie/Modules/reporter_module.py:48 +msgid "news.sources.ask" +msgstr "" +"Do you have any preference for the source of your news? like CNNor " +"Time magazine or maybe The hindu?" + +#: Stephanie/Modules/reporter_module.py:56 +msgid "news.sources.list" +msgstr "Out of all the sources as follows" + +#: Stephanie/Modules/reporter_module.py:59 +#: Stephanie/Modules/reporter_module.py:74 +msgid "news.sources.select" +msgstr ", which one would you like to pick?" + +#: Stephanie/Modules/reporter_module.py:64 +msgid "news.sources.all.ask" +msgstr "" +"Do you want me to list all the sources? There are around 70 so it may take" +"a while. Or you can let me know of your preferred source name " +"and I would let you know if it's available or not." + +#: Stephanie/Modules/reporter_module.py:70 +msgid "news.sources.all.ask" +msgstr "No problem, here are all the available sources as follows " + +#: Stephanie/Modules/reporter_module.py:86 +#, python-brace-format +msgid "news.sort.two_options" +msgstr "And what kind of news sort would you like? {0} or {1}?" + +#: Stephanie/Modules/reporter_module.py:88 +#, python-brace-format +msgid "news.sort.three_options" +msgstr "And what kind of news sort would you like? {0} or {1}, or maybe {2}?" + +#: Stephanie/Modules/reporter_module.py:97 +msgid "news.sort.described_options" +msgstr "" +"And what kind of news sort would you like? The latest or maybe top ones shown in " +"front page?" + +#: Stephanie/Modules/reporter_module.py:122 +#, python-brace-format +msgid "news.report" +msgstr "So the {0} news from {1} news source are as follows " + +#: Stephanie/Modules/reporter_module.py:129 +#, python-brace-format +msgid "news.report.by" +msgstr "was reported by {0}." + +#: Stephanie/Modules/reporter_module.py:130 +msgid "news.report.continue" +msgstr "and in the other news. " + +#: Stephanie/Modules/google_calendar_module.py:124 +msgid "calendar.add.successful" +msgstr "Okay, I added it to your calendar" + +#: Stephanie/Modules/google_calendar_module.py:154 +msgid "calendar.events.today.none" +msgstr "You have no events scheduled for today" + +#: Stephanie/Modules/google_calendar_module.py:220 +msgid "calendar.events.tomorrow.none" +msgstr "You have no events scheduled for tomorrow" + +#: Stephanie/Modules/google_calendar_module.py:253 +msgid "complete" +msgstr "That's it." + +#: Stephanie/Modules/alpha_search_module.py:26 +msgid "rephrase.ask" +msgstr "Can you possibly phrase it a bit better?" + +#: Stephanie/Modules/alpha_search_module.py:31 +msgid "error.search.no_results" +"Sorry, I couldn't find what you asked for, maybe try being a little more " +"specific." + +#: Stephanie/Modules/alpha_search_module.py:33 +msgid "error.search.wolframalpha" +msgstr "" +"It seems something is wrong with the wolframalpha search engine, maybe try " +"asking later." + +#: Stephanie/Modules/alpha_search_module.py:35 +msgid "error.search.no_api_token" +"Seems you haven't provided the API TOKEN for search engine, please add it in " +"config file." +msgstr "" + +#: Stephanie/Modules/alpha_search_module.py:36 +msgid "error.search.wolframalpha.no_api_token" +msgstr "" +"API TOKEN for wolframalpha search engine is missing, head in to docs to see " +"how to properly fill the configurations for search engine." + +#: Stephanie/Modules/alpha_search_module.py:38 +msgid "error.search.incorrect_api_token" +msgstr "" +"Seems you haven't provided the API TOKEN or it's wrong for search engine, " +"please add it in config file." + +#: Stephanie/Modules/alpha_search_module.py:39 +msgid "error.search.wolframalpha.incorrect_api_token" +msgstr "" +"API TOKEN for wolframalpha search engine is missing or is invalid, head in " +"to docs to see how to properly fill the configurations for search engine." + +#: Stephanie/Modules/evernote_module.py:36 +#: Stephanie/Modules/evernote_module.py:43 +msgid "error.note.create" +msgstr "" +"Note wasn't created successfully. There may have been a spelling error... Please" +"refer back to the docs." + +#: Stephanie/Modules/evernote_module.py:41 +msgid "note.create.success" +msgstr "I successfully wrote down your note." + +#: Stephanie/Modules/movie_information_module.py:17 +#, python-brace-format +msgid "movie.ask_confirmation" +msgstr "Is the movie you're referring to {0}, released in {1}" + +#: Stephanie/Modules/movie_information_module.py:20 +#, python-brace-format +msgid "movie.suggest" +msgstr "Alright, then how about {0}, released in {1}" + +#: Stephanie/Modules/movie_information_module.py:25 +msgid "movie.moody" +msgstr "Alright dude, you are kind of moody." + +#: Stephanie/Modules/movie_information_module.py:28 +msgid "found" +msgstr "found" + +#: Stephanie/Modules/movie_information_module.py:31 +msgid "movie.ask_repeat" +msgstr "Sorry, but your pronounciation is awful. Try again" + +#: Stephanie/Modules/movie_information_module.py:36 +#, python-brace-format +msgid "movie.report" +msgstr "" +"{0} was released in {1}, directed by {2} of genre {3} has a runtime of about " +"{4} garnered a rating of {5} featuring {6} had a plot such as {7}" + +#: Stephanie/Modules/system_module.py:15 +msgid "life.meaning" +msgstr "42 is the meaning of life." + +#: Stephanie/Modules/system_module.py:30 +#, python-brace-format +msgid "greeting.sir" +msgstr "{0}, sir!" + +#: Stephanie/Modules/system_module.py:32 +#, python-brace-format +msgid "greeting.mam" +msgstr "{0}, mam!" + +#: Stephanie/Modules/system_module.py:34 +#, python-brace-format +msgid "greeting.dear" +msgstr "{0}, dear!" + +#: Stephanie/Modules/system_module.py:47 +msgid "system.sleep" +msgstr "Sleep for the weak!" + +#: Stephanie/Modules/system_module.py:51 +msgid "system.quit" +msgstr "I will come back stronger!" + +#: Stephanie/Modules/system_module.py:66 +#, python-brace-format +msgid "system.version" +msgstr "I am currently running on {0} version {1}. " + +#: Stephanie/Modules/system_module.py:67 +#, python-brace-format +msgid "system.name" +msgstr "This system is named {0} and has {1} CPU cores. " + +#: Stephanie/Modules/system_module.py:68 +#, python-brace-format +msgid "system.disk_percent" +msgstr "Current disk_percent is {0} percent. " + +#: Stephanie/Modules/system_module.py:69 +#, python-brace-format +msgid "system.cpu" +msgstr "Current CPU utilization is {0} percent. " + +#: Stephanie/Modules/system_module.py:70 +#, python-brace-format +msgid "system.memory" +msgstr "Current memory utilization is {0} percent. " + +#: Stephanie/Modules/system_module.py:71 +#, python-brace-format +msgid "system.running_since" +msgstr "it's running since {0}." + +#: Stephanie/Modules/system_module.py:111 +#, python-brace-format +msgid "time.now" +msgstr "The time is {0} {1} {2}" + +#: Stephanie/Modules/system_module.py:134 +msgid "greeting.morning" +msgstr "Good Morning" + +#: Stephanie/Modules/system_module.py:136 +msgid "greeting.afternoon" +msgstr "Good Afternoon" + +#: Stephanie/Modules/system_module.py:138 +msgid "greeting.evening" +msgstr "Good Evening" + +#: Stephanie/Modules/zomato_module.py:19 +msgid "error.zomato.missing_info" +msgstr "Your api key wasn't provided or maybe your city isn't available." + +#: Stephanie/Modules/zomato_module.py:22 +msgid "restaurant.recommendation.none" +msgstr "No good places to eat found nearby your location." + +#: Stephanie/Modules/zomato_module.py:25 +#, python-brace-format +msgid "restaurant.recommendation" +msgstr "" +"{0} situated nearby {1} is found, it offers cuisines like {2} with an " +"average price range of {3} {4} per person, and over {5} people haverated " +"this place with an average ratings as{6}. So would you like to order this " +"place?" + +#: Stephanie/Modules/zomato_module.py:40 +msgid "thanks" +msgstr "Thank you." + +#: Stephanie/Modules/zomato_module.py:41 +msgid "restaurant.recommendation.alternative" +msgstr "okay, then how about this one? " + +#: Stephanie/Modules/zomato_module.py:42 +msgid "restaurant.recommendation.complete" +msgstr "That's all the restaurants available near your location." + +#: Stephanie/Modules/twitter_module.py:42 +msgid "twitter.trends.top" +msgstr "these were the top 5 trends on twitter globally." + +#: Stephanie/Modules/twitter_module.py:45 +msgid "twitter.tweet.ask" +msgstr "What would you like to tweet?" + +#: Stephanie/Modules/twitter_module.py:48 +#, python-brace-format +msgid "twitter.tweet.successful" +msgstr "{0} has been tweeted" + +#: Stephanie/Modules/twitter_module.py:75 +msgid "twitter.retweets" +msgstr "Latest Retweets are " + +#: Stephanie/Modules/twitter_module.py:77 +msgid "join.by" +msgstr " by " + +#: Stephanie/Modules/twitter_module.py:79 +msgid "twitter.retweets.none" +msgstr "You have no re-tweets. " + +#: Stephanie/Modules/twitter_module.py:82 +msgid "twitter.mentions.latest" +msgstr "Latest Mentions are " + +#: Stephanie/Modules/twitter_module.py:88 +msgid "twitter.mentions.none" +msgstr "You have no mentions. " + +#: Stephanie/Modules/twitter_module.py:98 +msgid "twitter.notifications.latest" +msgstr "These were the latest notifications." + +#: Stephanie/Modules/football_module.py:103 +#: Stephanie/Modules/football_module.py:114 +#: Stephanie/Modules/football_module.py:166 +#: Stephanie/Modules/football_module.py:177 +#: Stephanie/Modules/football_module.py:188 +#: Stephanie/Modules/football_module.py:199 +#: Stephanie/Modules/football_module.py:210 +#: Stephanie/Modules/football_module.py:221 +#: Stephanie/Modules/football_module.py:232 +msgid "alright.blimey" +msgstr "Alright then blimey." + +#: Stephanie/Modules/weather_report_module.py:68 +#, python-brace-format +msgid "weather.today" +msgstr "" +"Weather at {0}. Today is {1}. There is a chance of {2}. Now Temperature is " +"{3} degree {4}. Humidity {5} percent. Wind Speed {6} with cloud cover {7} " +"percent." + +#: Stephanie/Modules/weather_report_module.py:75 +#, python-brace-format +msgid "weather.tomorrow" +msgstr "" +"Weather at {0}. Tomorrow will be {1}. There will be a chance of {2}. " +"Temperature in the morning {3} degree {4}. Days Temperature will be {5} " +"degree {4}. and Temperature at night will be {6} degree {4}. Humidity {7} " +"percent. Wind Speed {8} with clouds cover {9} percent." + +#: Stephanie/Modules/weather_report_module.py:80 +#, python-brace-format +msgid "weather.next_week" +msgstr "Weather forecast for next week at {0}. " + +#: Stephanie/Modules/weather_report_module.py:83 +msgid "weather.rain.days" +msgstr "Rainy Days are " + +#: Stephanie/Modules/weather_report_module.py:94 +msgid "weather.rain.most" +msgstr "You will observe heavy rain on " + +#: Stephanie/Modules/weather_report_module.py:102 +msgid "weather.sun.days" +msgstr "Sunny Days are " + +#: Stephanie/Modules/weather_report_module.py:113 +msgid "weather.sun.most" +msgstr "You will feel heat on " + +#: Stephanie/Modules/weather_report_module.py:121 +msgid "weather.wind.day" +msgstr "Most windy day will be " + +#: Stephanie/Modules/weather_report_module.py:129 +msgid "weather.humid.day" +msgstr "Most humid day will be " + +#: Stephanie/Modules/weather_report_module.py:137 +msgid "weather.cold.day" +msgstr "Coolest day will be " + +#: Stephanie/Modules/wikipedia_module.py:14 +msgid "encyclopedia.search.ask" +msgstr "What would you like to know about?" + +#: Stephanie/Modules/wikipedia_module.py:36 +msgid "encyclopedia.search.no_results" +msgstr "Sorry, I couldn't find any article with that title. :sadface:" + +#: Stephanie/Modules/wikipedia_module.py:43 +msgid "error.encyclopedia.search" +msgstr "Unable to search your given query." + +#: Stephanie/Modules/base_module.py:18 +#, python-brace-format +msgid "error.no_api_keys" +msgstr "API keys for {0} were not provided in the config.ini file. Please refer back to the docs." + +#: Stephanie/Modules/base_module.py:23 +#, python-brace-format +msgid "error.incorrect_api_keys" +msgstr "The API key was incorrect or wasn't provided at all for {0}. Please refer back to the docs." + +#: Stephanie/TextManager/speaker.py:26 +msgid "error.speaker.default" +msgstr "Default Audio Player for mp3 files is not set up, like vlc or something." + +#: Stephanie/TextManager/speaker.py:30 +msgid "error.eyed3_package.unknown" +msgstr "" +"Seems like eyed3 named package wasn't installed probably Check back at the " +"support tab in the main website. Or if you're trying to close the " +"application abruptly, keep pressing CTRL + C repeatedly." + +#: Stephanie/TextManager/text_manager.py:18 +msgid "error.google_text.unknown" +msgstr "" +"Some issue with google text to speech mechanism, change to some other " +"service. Or you can wait and try turning it off and on again." + +#: Stephanie/TextManager/text_manager.py:30 +msgid "error.google_text.save" +msgstr "" +"Look it shouldn't happen but since it happened, just get to support tab of " +"main website mate, some issue with os is what I assume unless you haven't " +"changed code if in that caseman, well." + +#: Stephanie/EventDispatcher/event_dispatcher.py:15 +#, python-brace-format +msgid "virtual_assistant.sleep" +msgstr "The virtual assistant is going to sleep by {0} method" + +#: Stephanie/EventDispatcher/event_dispatcher.py:20 +#, python-brace-format +msgid "virtual_assistant.quit" +msgstr "The virtual assistant is being quit by {0} method" + +#: Stephanie/boot.py:24 +msgid "modules.init.start" +msgstr "Modules are being initialised..." + +#: Stephanie/boot.py:26 +msgid "modules.init.complete" +msgstr "Modules were initialised." +#: Stephanie/boot.py:28 +msgid "stephanie.ready" +msgstr "Stephanie is on and loading, wait for the beep sound to give your command." From a16bcc3199257693192f3b298cd82d75486b1cf1 Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 24 Nov 2017 13:30:41 +0700 Subject: [PATCH 13/14] Added italian translations using Google translate --- Stephanie/Modules/reporter_module.py | 2 +- Stephanie/locales/en/LC_MESSAGES/messages.po | 9 +- Stephanie/locales/it/LC_MESSAGES/messages.po | 649 ++++++++++++++++--- 3 files changed, 581 insertions(+), 79 deletions(-) diff --git a/Stephanie/Modules/reporter_module.py b/Stephanie/Modules/reporter_module.py index 840a0f3..17f53c2 100644 --- a/Stephanie/Modules/reporter_module.py +++ b/Stephanie/Modules/reporter_module.py @@ -64,7 +64,7 @@ def get_news(self): all_sources_status = self.assistant.listen().decipher() sources_available = self.all_sources() if all_sources_status.upper() in self.AFFIRMATIVE: - response = _("news.sources.all.ask") + response = _("news.sources.all") sources_available_list = list(sources_available) for source_name in sources_available_list: response += " %s," % source_name diff --git a/Stephanie/locales/en/LC_MESSAGES/messages.po b/Stephanie/locales/en/LC_MESSAGES/messages.po index 928279a..b210344 100644 --- a/Stephanie/locales/en/LC_MESSAGES/messages.po +++ b/Stephanie/locales/en/LC_MESSAGES/messages.po @@ -3,6 +3,8 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # +msgid "" +msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-10-22 14:11+0700\n" @@ -11,7 +13,7 @@ "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: Stephanie/updater.py:18 @@ -215,7 +217,7 @@ msgstr "" "and I would let you know if it's available or not." #: Stephanie/Modules/reporter_module.py:70 -msgid "news.sources.all.ask" +msgid "news.sources.all" msgstr "No problem, here are all the available sources as follows " #: Stephanie/Modules/reporter_module.py:86 @@ -270,6 +272,7 @@ msgstr "Can you possibly phrase it a bit better?" #: Stephanie/Modules/alpha_search_module.py:31 msgid "error.search.no_results" +msgstr "" "Sorry, I couldn't find what you asked for, maybe try being a little more " "specific." @@ -281,9 +284,9 @@ msgstr "" #: Stephanie/Modules/alpha_search_module.py:35 msgid "error.search.no_api_token" +msgstr "" "Seems you haven't provided the API TOKEN for search engine, please add it in " "config file." -msgstr "" #: Stephanie/Modules/alpha_search_module.py:36 msgid "error.search.wolframalpha.no_api_token" diff --git a/Stephanie/locales/it/LC_MESSAGES/messages.po b/Stephanie/locales/it/LC_MESSAGES/messages.po index 3d1fc16..01f7da5 100644 --- a/Stephanie/locales/it/LC_MESSAGES/messages.po +++ b/Stephanie/locales/it/LC_MESSAGES/messages.po @@ -3,116 +3,615 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # -#: src/link/to/my/src:67 msgid "" msgstr "" -"Project-Id-Version: xxx\n" +"Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-07-06 12:31-0500\n" -"PO-Revision-Date: 2011-05-27 22:37+0100\n" -"Last-Translator: My NAME\n" -"Language-Team: TEAM \n" +"POT-Creation-Date: 2017-10-22 14:11+0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: Stephanie/boot.py:25 -msgid "Stephanie is on and loading, wait for the beep sound to give your command." -msgstr "Italian Version: Stephanie is on and loading, wait for the beep sound to give your command." +#: Stephanie/updater.py:18 +msgid "error.update.failed_request" +msgstr "Impossibile accedere alle informazioni sull'aggiornamento della versione di stephanie." -#: Stephanie/AudioManager/audio_recognizer.py:16 -msgid "sphinx_audio_understood" -msgstr "Italian Version: sphinx_audio_understood" +#: Stephanie/updater.py:22 +#, python-brace-format +msgid "update.old_version" +msgstr "La versione dell'assistente virtuale è {0}, mentre l'ultima è {1}" -#: Stephanie/AudioManager/audio_recognizer.py:19 -msgid "Sphinx could not understand audio" -msgstr "Italian Version: Sphinx could not understand audio" +#: Stephanie/updater.py:24 +msgid "update.url" +msgstr "" +"Gentilmente, visita il sito Web principale di stephanie all'indirizzo www.github.com/slapbot/" +"stephanie-va per aggiornare il software alla sua ultima versione." -#: Stephanie/AudioManager/audio_recognizer.py:22 -msgid "Sphinx error; {0}" -msgstr "Italian Version: Sphinx error; {0}" +#: Stephanie/updater.py:32 +msgid "error.update.failed_process" +msgstr "C'è qualche problema nel ricevere informazioni sull'aggiornamento della versione." -#: Stephanie/AudioManager/audio_recognizer.py:31 -msgid "Google Speech Recognition thinks you said " -msgstr "Italian Version: Google Speech Recognition thinks you said " +#: Stephanie/AudioManager/audio_getter.py:17 +msgid "command.ask" +msgstr "Dammi il tuo comando!" -#: Stephanie/AudioManager/audio_recognizer.py:34 -msgid "Google Recognition couldn't understand your audio with enough confidence." -msgstr "Italian Version: Google Recognition couldn't understand your audio with enough confidence." +#: Stephanie/AudioManager/audio_getter.py:28 +msgid "command.processing" +msgstr "Comando di elaborazione ..." + +#: Stephanie/AudioManager/audio_getter.py:39 +#: Stephanie/Modules/system_module.py:12 +msgid "command.ask_repeat" +msgstr "Chiedo scusa, potresti ripetere il comando ancora una volta?" + +#: Stephanie/AudioManager/audio_recognizer.py:16 +#: Stephanie/AudioManager/audio_recognizer.py:31 +#: Stephanie/AudioManager/audio_recognizer.py:52 +#: Stephanie/AudioManager/audio_recognizer.py:71 +#: Stephanie/AudioManager/audio_recognizer.py:90 +#: Stephanie/AudioManager/audio_recognizer.py:112 +#: Stephanie/AudioManager/audio_recognizer.py:134 +#, python-brace-format +msgid "audio.repeat_input" +msgstr "{0} pensa che tu abbia detto" +#: Stephanie/AudioManager/audio_recognizer.py:19 #: Stephanie/AudioManager/audio_recognizer.py:36 -msgid "Google Speech Recognition could not understand audio" -msgstr "Italian Version: Google Speech Recognition could not understand audio" +#: Stephanie/AudioManager/audio_recognizer.py:55 +#: Stephanie/AudioManager/audio_recognizer.py:74 +#: Stephanie/AudioManager/audio_recognizer.py:93 +#: Stephanie/AudioManager/audio_recognizer.py:115 +#: Stephanie/AudioManager/audio_recognizer.py:137 +#, python-brace-format +msgid "error.audio.failed_understand" +msgstr "{0} non ha potuto capire l'audio" +#: Stephanie/AudioManager/audio_recognizer.py:22 #: Stephanie/AudioManager/audio_recognizer.py:39 -msgid "Could not request results from Google Speech Recognition service; {0}" -msgstr "Italian Version: Could not request results from Google Speech Recognition service; {0}" +#: Stephanie/AudioManager/audio_recognizer.py:58 +#: Stephanie/AudioManager/audio_recognizer.py:77 +#: Stephanie/AudioManager/audio_recognizer.py:96 +#: Stephanie/AudioManager/audio_recognizer.py:118 +#: Stephanie/AudioManager/audio_recognizer.py:140 +#, python-brace-format +msgid "error.audio.failed_request_service" +msgstr "Impossibile richiedere risultati dal servizio {0}; {1}" + +#: Stephanie/AudioManager/audio_recognizer.py:34 +msgid "error.audio.google_recognition.failed_understand" +msgstr "Google Recognition non ha potuto capire il tuo audio con sufficiente sicurezza." #: Stephanie/AudioManager/audio_recognizer.py:47 #: Stephanie/AudioManager/audio_recognizer.py:67 #: Stephanie/AudioManager/audio_recognizer.py:86 #: Stephanie/AudioManager/audio_recognizer.py:107 #: Stephanie/AudioManager/audio_recognizer.py:129 -msgid "Api key not found in the config.ini file." -msgstr "Italian Version: Api key not found in the config.ini file." +msgid "error.missing_api_key" +msgstr "Chiave Api non trovata nel file config.ini." -#: Stephanie/AudioManager/audio_recognizer.py:52 -msgid "Google Cloud Speech thinks you said " -msgstr "Italian Version: Google Cloud Speech thinks you said" +#: Stephanie/configurer.py:24 +msgid "error.format_modules_file" +msgstr "" +"Il file Modules.json non è stato formattato correttamente, controlla la scheda di supporto in" +"caso che stai integrando qualche modulo di terze parti." -#: Stephanie/AudioManager/audio_recognizer.py:55 -msgid "Google Cloud Speech could not understand audio" -msgstr "Italian Version: Google Cloud Speech could not understand audio" +#: Stephanie/Modules/facebook_module.py:59 +msgid "error.facebook.access.birthdays" +msgstr "" +"Non sono autorizzato a interrogare il tuo Facebook. Se desideri" +"controlla i compleanni in futuro, visita la dashboard di Jasper." -#: Stephanie/AudioManager/audio_recognizer.py:58 -msgid "Could not request results from Google Cloud Speech service; {0}" -msgstr "Italian Version: Could not request results from Google Cloud Speech service; {0}" +#: Stephanie/Modules/facebook_module.py:64 +#: Stephanie/Modules/facebook_module.py:108 +#: Stephanie/Modules/facebook_module.py:133 +msgid "error.service.unknown" +msgstr "Mi scuso, c'è un problema con quel servizio al momento." -#: Stephanie/AudioManager/audio_recognizer.py:71 -msgid "Wit.ai thinks you said " -msgstr "Italian Version: Wit.ai thinks you said " +#: Stephanie/Modules/facebook_module.py:78 +#, python-brace-format +msgid "birthday.friend.today" +msgstr "{0} ha un compleanno oggi." -#: Stephanie/AudioManager/audio_recognizer.py:74 -msgid "Wit.ai could not understand audio" -msgstr "Italian Version: Wit.ai could not understand audio" +#: Stephanie/Modules/facebook_module.py:80 +msgid "birthday.friends.today" +msgstr "I tuoi amici con i compleanni oggi sono" -#: Stephanie/AudioManager/audio_recognizer.py:77 -msgid "Could not request results from Wit.ai service; {0}" -msgstr "Italian Version: Could not request results from Wit.ai service; {0}" +#: Stephanie/Modules/facebook_module.py:81 +msgid "join.and" +msgstr " e " -#: Stephanie/AudioManager/audio_recognizer.py:90 -msgid "Microsoft Bing Voice Recognition thinks you said " -msgstr "Italian Version: Microsoft Bing Voice Recognition thinks you said" +#: Stephanie/Modules/facebook_module.py:83 +msgid "birthday.none.today" +msgstr "Nessuno dei tuoi amici ha un compleanno oggi." -#: Stephanie/AudioManager/audio_recognizer.py:93 -msgid "Microsoft Bing Voice Recognition could not understand audio" -msgstr "Italian Version: Microsoft Bing Voice Recognition could not understand audio" +#: Stephanie/Modules/facebook_module.py:103 +#: Stephanie/Modules/facebook_module.py:128 +msgid "error.facebook.access.notifications" +msgstr "" +"Non sono autorizzato a interrogare il tuo Facebook. Se desideri" +"controlla le tue notifiche in futuro, visita la Stephanie facebook" +"configurazione del modulo." -#: Stephanie/AudioManager/audio_recognizer.py:96 -msgid "Could not request results from Microsoft Bing Voice Recognition service; {0}" -msgstr "Italian Version: Could not request results from Microsoft Bing Voice Recognition service; {0}" +#: Stephanie/Modules/facebook_module.py:110 +msgid "facebook.notifications.none" +msgstr "Non hai notifiche di Facebook." -#: Stephanie/AudioManager/audio_recognizer.py:112 -msgid "Houndify thinks you said " -msgstr "Italian Version: Houndify thinks you said " +#: Stephanie/Modules/facebook_module.py:117 +#, python-brace-format +msgid "facebook.notifications" +msgstr "Hai {0} notifiche di Facebook." -#: Stephanie/AudioManager/audio_recognizer.py:115 -msgid "Houndify could not understand audio" -msgstr "Italian Version: Houndify could not understand audio" +#: Stephanie/Modules/gmail_module.py:25 +msgid "error.gmail.access" +msgstr "" +"O le tue credenziali sono accoppiamenti sbagliati, o c'è qualche problema in corso" +"Fammi un favore, so che non lo farai ma qualunque cosa, solo informami nei forum." -#: Stephanie/AudioManager/audio_recognizer.py:118 -msgid "Could not request results from Houndify service; {0}" -msgstr "Italian Version: Could not request results from Houndify service; {0}" +#: Stephanie/Modules/gmail_module.py:116 +#, python-brace-format +msgid "gmail.unread.latest" +msgstr "" +"Hai {0} email non lette, di cui le ultime 5 sono le seguenti," +"per favore aspetta un secondo, mentre elaboro" -#: Stephanie/AudioManager/audio_recognizer.py:134 -msgid "IBM Speech to Text thinks you said " -msgstr "Italian Version: IBM Speech to Text thinks you said " +#: Stephanie/Modules/gmail_module.py:122 +msgid "error.gmail.authentication" +msgstr "Mi dispiace, non sono autenticato per lavorare con Gmail." -#: Stephanie/AudioManager/audio_recognizer.py:137 -msgid "IBM Speech to Text could not understand audio" -msgstr "Italian Version: IBM Speech to Text could not understand audio" +#: Stephanie/Modules/gmail_module.py:125 +msgid "gmail.unread.none" +msgstr "Non hai email non lette." -#: Stephanie/AudioManager/audio_recognizer.py:140 -msgid "Could not request results from IBM Speech to Text service; {0}" -msgstr "Italian Version: Could not request results from IBM Speech to Text service; {0}" +#: Stephanie/Modules/gmail_module.py:127 +#, python-brace-format +msgid "gmail.unread.one" +msgstr "Hai un'email non letta da {0}." + +#: Stephanie/Modules/gmail_module.py:129 +#, python-brace-format +msgid "gmail.unread" +msgstr "Hai {0} email non lette" + +#: Stephanie/Modules/gmail_module.py:132 +msgid "gmail.senders" +msgstr ". I mittenti includono:: " + +#: Stephanie/Modules/gmail_module.py:135 Stephanie/Modules/twitter_module.py:85 +msgid "join.from" +msgstr " a partire dal " + +#: Stephanie/Modules/reporter_module.py:18 +msgid "error.news.configuration" +msgstr "" +"Si prega di consultare la documentazione per configurare correttamente il modulo di notizie" +"Soprattutto le chiavi API." + +#: Stephanie/Modules/reporter_module.py:41 +msgid "news.category.ask" +msgstr "Preferiresti una categoria specifica? Se sì, allora quale sarebbe?" + +#: Stephanie/Modules/reporter_module.py:48 +msgid "news.sources.ask" +msgstr "" +"Hai qualche preferenza per la fonte delle tue notizie? Come CNNor" +"Time magazine o forse The indù?" + +#: Stephanie/Modules/reporter_module.py:56 +msgid "news.sources.list" +msgstr "Tra tutte le fonti come segue" + +#: Stephanie/Modules/reporter_module.py:59 +#: Stephanie/Modules/reporter_module.py:74 +msgid "news.sources.select" +msgstr ", quale ti piacerebbe scegliere?" + +#: Stephanie/Modules/reporter_module.py:64 +msgid "news.sources.all.ask" +msgstr "" +"Vuoi che elenchi tutte le fonti? Ci sono circa 70 quindi potrebbe volerci" +"un po 'o puoi farmi sapere il tuo nome sorgente preferito" +"e ti farei sapere se è disponibile o meno." + +#: Stephanie/Modules/reporter_module.py:70 +msgid "news.sources.all" +msgstr "Nessun problema, qui ci sono tutte le fonti disponibili come segue" + +#: Stephanie/Modules/reporter_module.py:86 +#, python-brace-format +msgid "news.sort.two_options" +msgstr "E che tipo di notizie vorresti? {0} o {1}?" + +#: Stephanie/Modules/reporter_module.py:88 +#, python-brace-format +msgid "news.sort.three_options" +msgstr "E che tipo di notizie vorresti? {0} o {1}, o forse {2}?" + +#: Stephanie/Modules/reporter_module.py:97 +msgid "news.sort.described_options" +msgstr "" +"E che tipo di notizie vorresti? Le ultime o forse le migliori in" +"prima pagina?" + +#: Stephanie/Modules/reporter_module.py:122 +#, python-brace-format +msgid "news.report" +msgstr "Quindi le {0} notizie dalla {1} fonte di notizie sono le seguenti" + +#: Stephanie/Modules/reporter_module.py:129 +#, python-brace-format +msgid "news.report.by" +msgstr "è stato segnalato da {0}." + +#: Stephanie/Modules/reporter_module.py:130 +msgid "news.report.continue" +msgstr "e nelle altre notizie. " + +#: Stephanie/Modules/google_calendar_module.py:124 +msgid "calendar.add.successful" +msgstr "Ok, l'ho aggiunto al tuo calendario" + +#: Stephanie/Modules/google_calendar_module.py:154 +msgid "calendar.events.today.none" +msgstr "Non ci sono eventi in programma per oggi" + +#: Stephanie/Modules/google_calendar_module.py:220 +msgid "calendar.events.tomorrow.none" +msgstr "Non ci sono eventi in programma per domani" + +#: Stephanie/Modules/google_calendar_module.py:253 +msgid "complete" +msgstr "Questo è tutto." + +#: Stephanie/Modules/alpha_search_module.py:26 +msgid "rephrase.ask" +msgstr "Puoi forse esprimerlo un po 'meglio?" + +#: Stephanie/Modules/alpha_search_module.py:31 +msgid "error.search.no_results" +msgstr "" +"Scusa, non sono riuscito a trovare quello che hai chiesto, magari provare ad essere un po 'più" +"specifica." + +#: Stephanie/Modules/alpha_search_module.py:33 +msgid "error.search.wolframalpha" +msgstr "" +"Sembra che ci sia qualcosa di sbagliato nel motore di ricerca wolframalpha, magari provare" +"chiedendo dopo." + +#: Stephanie/Modules/alpha_search_module.py:35 +msgid "error.search.no_api_token" +msgstr "" +"Sembra che tu non abbia fornito l'API TOKEN per il motore di ricerca, per favore aggiungilo in" +"file di configurazione." + +#: Stephanie/Modules/alpha_search_module.py:36 +msgid "error.search.wolframalpha.no_api_token" +msgstr "" +"Manca API TOKEN per il motore di ricerca wolframalpha, visita i documenti per vedere" +"come compilare correttamente le configurazioni per il motore di ricerca." + +#: Stephanie/Modules/alpha_search_module.py:38 +msgid "error.search.incorrect_api_token" +msgstr "" +"Sembra che tu non abbia fornito l'API TOKEN o che sia sbagliato per il motore di ricerca" +"per favore aggiungilo nel file di configurazione." + +#: Stephanie/Modules/alpha_search_module.py:39 +msgid "error.search.wolframalpha.incorrect_api_token" +msgstr "" +"API TOKEN per il motore di ricerca wolframalpha manca o non è valido, vai avanti" +"a documenti per vedere come riempire correttamente le configurazioni per il motore di ricerca." + +#: Stephanie/Modules/evernote_module.py:36 +#: Stephanie/Modules/evernote_module.py:43 +msgid "error.note.create" +msgstr "" +"La nota non è stata creata correttamente. Potrebbe essersi verificato un errore di ortografia ... Per favore" +"rimandi ai documenti." + +#: Stephanie/Modules/evernote_module.py:41 +msgid "note.create.success" +msgstr "Ho scritto con successo il tuo messaggio." + +#: Stephanie/Modules/movie_information_module.py:17 +#, python-brace-format +msgid "movie.ask_confirmation" +msgstr "Il film ti stai riferendo a {0}, pubblicato in {1}" + +#: Stephanie/Modules/movie_information_module.py:20 +#, python-brace-format +msgid "movie.suggest" +msgstr "Va bene, allora che ne dici di {0}, rilasciato in {1}" + +#: Stephanie/Modules/movie_information_module.py:25 +msgid "movie.moody" +msgstr "Va bene amico, sei un po 'lunatico." + +#: Stephanie/Modules/movie_information_module.py:28 +msgid "found" +msgstr "trovato" + +#: Stephanie/Modules/movie_information_module.py:31 +msgid "movie.ask_repeat" +msgstr "Scusa, ma la tua pronuncia è orribile. Prova ancora" + +#: Stephanie/Modules/movie_information_module.py:36 +#, python-brace-format +msgid "movie.report" +msgstr "" +"{0} è stato rilasciato in {1}, diretto da {2} di genere {3} ha un runtime di circa" +"{4} ha ottenuto una valutazione di {5} con {6} ha avuto una trama come {7}" + +#: Stephanie/Modules/system_module.py:15 +msgid "life.meaning" +msgstr "42 è il significato della vita." + +#: Stephanie/Modules/system_module.py:30 +#, python-brace-format +msgid "greeting.sir" +msgstr "{0}, signore!" + +#: Stephanie/Modules/system_module.py:32 +#, python-brace-format +msgid "greeting.mam" +msgstr "{0}, mamma!" + +#: Stephanie/Modules/system_module.py:34 +#, python-brace-format +msgid "greeting.dear" +msgstr "{0}, caro!" + +#: Stephanie/Modules/system_module.py:47 +msgid "system.sleep" +msgstr "Dormire è per i deboli!" + +#: Stephanie/Modules/system_module.py:51 +msgid "system.quit" +msgstr "Tornerò più forte!" + +#: Stephanie/Modules/system_module.py:66 +#, python-brace-format +msgid "system.version" +msgstr "Attualmente sto girando su {0} versione {1}. " + +#: Stephanie/Modules/system_module.py:67 +#, python-brace-format +msgid "system.name" +msgstr "Questo sistema è chiamato {0} e ha {1} core della CPU. " + +#: Stephanie/Modules/system_module.py:68 +#, python-brace-format +msgid "system.disk_percent" +msgstr "L'attuale spesa del disco è {0} percento. " + +#: Stephanie/Modules/system_module.py:69 +#, python-brace-format +msgid "system.cpu" +msgstr "L'utilizzo attuale della CPU è {0} percento. " + +#: Stephanie/Modules/system_module.py:70 +#, python-brace-format +msgid "system.memory" +msgstr "L'utilizzo della memoria corrente è {0} percento." + +#: Stephanie/Modules/system_module.py:71 +#, python-brace-format +msgid "system.running_since" +msgstr "è in esecuzione dal {0}." + +#: Stephanie/Modules/system_module.py:111 +#, python-brace-format +msgid "time.now" +msgstr "Il tempo è {0} {1} {2}" + +#: Stephanie/Modules/system_module.py:134 +msgid "greeting.morning" +msgstr "Buongiorno" + +#: Stephanie/Modules/system_module.py:136 +msgid "greeting.afternoon" +msgstr "Buon pomeriggio" + +#: Stephanie/Modules/system_module.py:138 +msgid "greeting.evening" +msgstr "Buona serata" + +#: Stephanie/Modules/zomato_module.py:19 +msgid "error.zomato.missing_info" +msgstr "La tua chiave APi non è stata fornita o forse la tua città non è disponibile." + +#: Stephanie/Modules/zomato_module.py:22 +msgid "restaurant.recommendation.none" +msgstr "Nessun buon posto dove mangiare trovato nelle vicinanze della tua posizione." + +#: Stephanie/Modules/zomato_module.py:25 +#, python-brace-format +msgid "restaurant.recommendation" +msgstr "" +"{0} situato nelle vicinanze {1} è trovato, offre cucine come {2} con un" +"fascia di prezzo medio di {3} {4} a persona e oltre {5} persone haverato" +"questo posto con una valutazione media come {6}. Quindi ti piacerebbe ordinare questo" +"posto?" + +#: Stephanie/Modules/zomato_module.py:40 +msgid "thanks" +msgstr "Grazie." + +#: Stephanie/Modules/zomato_module.py:41 +msgid "restaurant.recommendation.alternative" +msgstr "okay, allora che ne dici di questo? " + +#: Stephanie/Modules/zomato_module.py:42 +msgid "restaurant.recommendation.complete" +msgstr "Sono tutti ristoranti disponibili vicino alla tua posizione." + +#: Stephanie/Modules/twitter_module.py:42 +msgid "twitter.trends.top" +msgstr "Queste sono state le prime 5 tendenze su twitter a livello globale." + +#: Stephanie/Modules/twitter_module.py:45 +msgid "twitter.tweet.ask" +msgstr "Cosa ti piacerebbe twittare?" + +#: Stephanie/Modules/twitter_module.py:48 +#, python-brace-format +msgid "twitter.tweet.successful" +msgstr "{0} è stato twittato" + +#: Stephanie/Modules/twitter_module.py:75 +msgid "twitter.retweets" +msgstr "Gli ultimi retweet sono" + +#: Stephanie/Modules/twitter_module.py:77 +msgid "join.by" +msgstr " di " + +#: Stephanie/Modules/twitter_module.py:79 +msgid "twitter.retweets.none" +msgstr "Non hai re-tweets. " + +#: Stephanie/Modules/twitter_module.py:82 +msgid "twitter.mentions.latest" +msgstr "Le ultime menzioni sono " + +#: Stephanie/Modules/twitter_module.py:88 +msgid "twitter.mentions.none" +msgstr "Non hai menzioni." + +#: Stephanie/Modules/twitter_module.py:98 +msgid "twitter.notifications.latest" +msgstr "Queste erano le ultime notifiche." + +#: Stephanie/Modules/football_module.py:103 +#: Stephanie/Modules/football_module.py:114 +#: Stephanie/Modules/football_module.py:166 +#: Stephanie/Modules/football_module.py:177 +#: Stephanie/Modules/football_module.py:188 +#: Stephanie/Modules/football_module.py:199 +#: Stephanie/Modules/football_module.py:210 +#: Stephanie/Modules/football_module.py:221 +#: Stephanie/Modules/football_module.py:232 +msgid "alright.blimey" +msgstr "Va bene, allora, bliney." + +#: Stephanie/Modules/weather_report_module.py:68 +#, python-brace-format +msgid "weather.today" +msgstr "" +"Meteo a {0}. Oggi è {1}. C'è una possibilità di {2}. Ora la temperatura è" +"{3} degree {4}. Umidità {5} percento Velocità del vento {6} con copertura nuvolosa {7}" +"per cento." + +#: Stephanie/Modules/weather_report_module.py:75 +#, python-brace-format +msgid "weather.tomorrow" +msgstr "" +"Meteo a {0}. Domani sarà {1}. Ci sarà la possibilità di {2}." +"Temperatura al mattino {3} laurea {4}. La temperatura dei giorni sarà {5}" +"grado {4} e temperatura di notte sarà {6} grado {4}. Umidità {7}" +"Percentuale: velocità del vento {8} con copertura delle nuvole {9} percento." + +#: Stephanie/Modules/weather_report_module.py:80 +#, python-brace-format +msgid "weather.next_week" +msgstr "Previsioni del tempo per la prossima settimana a {0}. " + +#: Stephanie/Modules/weather_report_module.py:83 +msgid "weather.rain.days" +msgstr "I giorni di pioggia sono " + +#: Stephanie/Modules/weather_report_module.py:94 +msgid "weather.rain.most" +msgstr "Osserverai la pioggia battente su " + +#: Stephanie/Modules/weather_report_module.py:102 +msgid "weather.sun.days" +msgstr "I giorni di sole sono " + +#: Stephanie/Modules/weather_report_module.py:113 +msgid "weather.sun.most" +msgstr "Sentirai calore " + +#: Stephanie/Modules/weather_report_module.py:121 +msgid "weather.wind.day" +msgstr "La giornata più ventosa sarà " + +#: Stephanie/Modules/weather_report_module.py:129 +msgid "weather.humid.day" +msgstr "Il giorno più umido sarà " + +#: Stephanie/Modules/weather_report_module.py:137 +msgid "weather.cold.day" +msgstr "La giornata più bella sarà " + +#: Stephanie/Modules/wikipedia_module.py:14 +msgid "encyclopedia.search.ask" +msgstr "Cosa ti piacerebbe sapere?" + +#: Stephanie/Modules/wikipedia_module.py:36 +msgid "encyclopedia.search.no_results" +msgstr "Scusa, non ho trovato nessun articolo con quel titolo. :sadface:" + +#: Stephanie/Modules/wikipedia_module.py:43 +msgid "error.encyclopedia.search" +msgstr "Impossibile cercare la query fornita." + +#: Stephanie/Modules/base_module.py:18 +#, python-brace-format +msgid "error.no_api_keys" +msgstr "Le chiavi API per {0} non sono state fornite nel file config.ini. Fai riferimento ai documenti." + +#: Stephanie/Modules/base_module.py:23 +#, python-brace-format +msgid "error.incorrect_api_keys" +msgstr "La chiave API non era corretta o non è stata fornita affatto per {0}. Fai riferimento ai documenti." + +#: Stephanie/TextManager/speaker.py:26 +msgid "error.speaker.default" +msgstr "Default Audio Player per file mp3 non è impostato, come vlc o qualcosa del genere." + +#: Stephanie/TextManager/speaker.py:30 +msgid "error.eyed3_package.unknown" +msgstr "" +"Sembra che il pacchetto con nome eyed3 non sia stato installato probabilmente Controlla indietro al" +"scheda di supporto nel sito Web principale o se stai cercando di chiudere il" +"Improvvisamente, continua a premere CTRL + C ripetutamente." + +#: Stephanie/TextManager/text_manager.py:18 +msgid "error.google_text.unknown" +msgstr "" +"Qualche problema con il meccanismo di sintesi vocale di google, passa ad un altro" +"servizio, oppure puoi aspettare e provare a spegnerlo e riaccenderlo." + +#: Stephanie/TextManager/text_manager.py:30 +msgid "error.google_text.save" +msgstr "" +"Guarda che non dovrebbe succedere ma da quando è successo, vai nella scheda di supporto di" +"compagno di sito principale, qualche problema con os è quello che presumo a meno che tu non abbia" +"ha cambiato codice se in quel caseman, beh." + +#: Stephanie/EventDispatcher/event_dispatcher.py:15 +#, python-brace-format +msgid "virtual_assistant.sleep" +msgstr "L'assistente virtuale sta andando a dormire con il metodo {0}" + +#: Stephanie/EventDispatcher/event_dispatcher.py:20 +#, python-brace-format +msgid "virtual_assistant.quit" +msgstr "L'assistente virtuale viene chiuso con il metodo {0}" + +#: Stephanie/boot.py:24 +msgid "modules.init.start" +msgstr "I moduli vengono inizializzati..." + +#: Stephanie/boot.py:26 +msgid "modules.init.complete" +msgstr "I moduli sono stati inizializzati." +#: Stephanie/boot.py:28 +msgid "stephanie.ready" +msgstr "Stephanie è acceso e in fase di caricamento, aspetta che venga emesso il segnale acustico." From 143d2c906ca9e2948c1ad43799761fec2d55064e Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 24 Nov 2017 16:40:18 +0700 Subject: [PATCH 14/14] Removed unneeded comments from wikipedia module --- Stephanie/Modules/wikipedia_module.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Stephanie/Modules/wikipedia_module.py b/Stephanie/Modules/wikipedia_module.py index 6675386..b84957f 100644 --- a/Stephanie/Modules/wikipedia_module.py +++ b/Stephanie/Modules/wikipedia_module.py @@ -3,17 +3,15 @@ import json from Stephanie.Modules.base_module import BaseModule from Stephanie.language import lang -from pprint import pprint + class WikipediaModule(BaseModule): def __init__(self, *args): super(WikipediaModule, self).__init__(*args) def give_a_summary(self): - # Translate this \/ self.assistant.say(_("encyclopedia.search.ask")) text = self.assistant.listen().decipher() - # add beep sound text = text.strip().replace(" ", "%20") request = Request( 'https://' + lang.get_code() + '.wikipedia.org/w/api.php?' @@ -27,16 +25,15 @@ def give_a_summary(self): ) ) output = data["query"]["pages"] + # check that the content of output contains a page or not - if list(output.keys())[0] is not '-1': # some page has been found + if list(output.keys())[0] is not '-1': final = output[list(output.keys())[0]]["extract"] return final else: - # Translate this \/ self.assistant.say(_("encyclopedia.search.no_results")) return None - - # handle final being None if the page wasn't found + return final except URLError: