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 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 8d5c721..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..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 %s method" % 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 %s method" % sender) + print(_("virtual_assistant.quit").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..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/base_module.py b/Stephanie/Modules/base_module.py index 4218dc2..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 '%s' is not provided in the config.ini file." - " Refer back to the docs, or just add the goddamn key." % 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 %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(_("error.incorrect_api_keys").format(key)) return False def write_configuration(self, key, value, section="MODULES"): @@ -30,4 +27,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..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 678ff5e..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 = people[0] + " has a birthday today." + 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,22 +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 " + str(count) + - " Facebook notifications. " + " ".join(updates) + ". ") + response = (_("facebook.notifications").format(str(count)) + " ".join(updates) + ". ") return response @@ -126,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 920230b..aa6fd3e 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.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 4c6098f..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,27 +112,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 = _("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 " + senders[0] + "." + return _("gmail.unread.one").format(senders[0]) else: - response = "You have %d unread emails" % len( - senders) + response = _("gmail.unread").format(len(senders)) unique_senders = list(set(senders)) if len(unique_senders) > 1: - unique_senders[-1] = 'and ' + 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 6c4f507..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 35f2017..c37452e 100644 --- a/Stephanie/Modules/movie_information_module.py +++ b/Stephanie/Modules/movie_information_module.py @@ -14,28 +14,33 @@ 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 = _("movie.ask_confirmation").format( movies[i].title, movies[i].year) else: - speech = "Alright, then how about %s, released in %s" % ( + 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") + 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 = "%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 = _("movie.report").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..17f53c2 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") 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,19 +80,18 @@ 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 = _("news.sort.two_options").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 = _("news.sort.three_options").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(_("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 %s news from %s news source are as follows " % (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 %s." % 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 8828289..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,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 _("greeting.sir").format(self.phase_of_the_day(t)) elif gender == "female": - return "%s, sir!" % self.phase_of_the_day(t) + return _("greeting.mam").format(self.phase_of_the_day(t)) else: - return "%s, sir!" % self.phase_of_the_day(t) + return _("greeting.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 _("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 %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 = _("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 %s %s %s" % (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 0274e23..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 "%s has been tweeted" % 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 56cac65..c1c0279 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.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 " + 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.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 " + 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) @@ -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 += _("weather.rain.most") 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 = _("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) @@ -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 += _("weather.sun.most") 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 += _("weather.wind.day") 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 += _("weather.humid.day") 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 += _("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/wikipedia_module.py b/Stephanie/Modules/wikipedia_module.py index bc54db9..b84957f 100644 --- a/Stephanie/Modules/wikipedia_module.py +++ b/Stephanie/Modules/wikipedia_module.py @@ -2,6 +2,7 @@ from urllib.error import URLError import json from Stephanie.Modules.base_module import BaseModule +from Stephanie.language import lang class WikipediaModule(BaseModule): @@ -9,11 +10,11 @@ def __init__(self, *args): super(WikipediaModule, self).__init__(*args) def give_a_summary(self): - self.assistant.say("What would you like to know about?") + self.assistant.say(_("encyclopedia.search.ask")) text = self.assistant.listen().decipher() 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 +25,16 @@ 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': + final = output[list(output.keys())[0]]["extract"] + return final + else: + self.assistant.say(_("encyclopedia.search.no_results")) + return None + return final except URLError: - return "Unable to search your given query." + return _("error.encyclopedia.search") diff --git a/Stephanie/Modules/zomato_module.py b/Stephanie/Modules/zomato_module.py index bfaa1ab..507d699 100644 --- a/Stephanie/Modules/zomato_module.py +++ b/Stephanie/Modules/zomato_module.py @@ -16,28 +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("%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?" - % ( - 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/TextManager/speaker.py b/Stephanie/TextManager/speaker.py index ddeaf0f..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 693e23a..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 3f159cb..35de566 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,17 @@ 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(_("modules.init.start")) + self.c.init_modules() + print(_("modules.init.complete")) + + print(_("stephanie.ready")) if self.c.config.getboolean("APPLICATION", "update_check"): self.updater.check_for_update() self.status = True diff --git a/Stephanie/configurer.py b/Stephanie/configurer.py index eeca8a5..082a300 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(_("error.format_modules_file")) from e return modules def get_modules(self, filename=None): 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() diff --git a/Stephanie/locales/en/LC_MESSAGES/messages.po b/Stephanie/locales/en/LC_MESSAGES/messages.po new file mode 100644 index 0000000..b210344 --- /dev/null +++ b/Stephanie/locales/en/LC_MESSAGES/messages.po @@ -0,0 +1,617 @@ +# 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. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \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/updater.py:18 +msgid "error.update.failed_request" +msgstr "Couldn't access stephanie's version update information." + +#: 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/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/updater.py:32 +msgid "error.update.failed_process" +msgstr "There's some problem in recieving version update information." + +#: Stephanie/AudioManager/audio_getter.py:17 +msgid "command.ask" +msgstr "Give me your command!" + +#: 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 +#: 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 +#: 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 "error.missing_api_key" +msgstr "Api key not found in the config.ini file." + +#: 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/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/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/Modules/facebook_module.py:78 +#, python-brace-format +msgid "birthday.friend.today" +msgstr "{0} has a birthday today." + +#: Stephanie/Modules/facebook_module.py:80 +msgid "birthday.friends.today" +msgstr "Your friends with birthdays today are " + +#: Stephanie/Modules/facebook_module.py:81 +msgid "join.and" +msgstr " and " + +#: Stephanie/Modules/facebook_module.py:83 +msgid "birthday.none.today" +msgstr "None of your friends have birthdays today." + +#: 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/Modules/facebook_module.py:110 +msgid "facebook.notifications.none" +msgstr "You have no Facebook notifications." + +#: Stephanie/Modules/facebook_module.py:117 +#, python-brace-format +msgid "facebook.notifications" +msgstr "You have {0} Facebook notifications. " + +#: 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/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/Modules/gmail_module.py:122 +msgid "error.gmail.authentication" +msgstr "I'm sorry. I'm not authenticated to work with your Gmail." + +#: Stephanie/Modules/gmail_module.py:125 +msgid "gmail.unread.none" +msgstr "You have no unread emails." + +#: 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" +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" +msgstr "" +"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" +msgstr "" +"Seems you haven't provided the API TOKEN for search engine, please add it in " +"config file." + +#: 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." diff --git a/Stephanie/locales/it/LC_MESSAGES/messages.po b/Stephanie/locales/it/LC_MESSAGES/messages.po new file mode 100644 index 0000000..01f7da5 --- /dev/null +++ b/Stephanie/locales/it/LC_MESSAGES/messages.po @@ -0,0 +1,617 @@ +# 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. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \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/updater.py:18 +msgid "error.update.failed_request" +msgstr "Impossibile accedere alle informazioni sull'aggiornamento della versione di stephanie." + +#: Stephanie/updater.py:22 +#, python-brace-format +msgid "update.old_version" +msgstr "La versione dell'assistente virtuale è {0}, mentre l'ultima è {1}" + +#: 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/updater.py:32 +msgid "error.update.failed_process" +msgstr "C'è qualche problema nel ricevere informazioni sull'aggiornamento della versione." + +#: Stephanie/AudioManager/audio_getter.py:17 +msgid "command.ask" +msgstr "Dammi il tuo comando!" + +#: 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 +#: 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 +#: 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 "error.missing_api_key" +msgstr "Chiave Api non trovata nel file config.ini." + +#: 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/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/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/Modules/facebook_module.py:78 +#, python-brace-format +msgid "birthday.friend.today" +msgstr "{0} ha un compleanno oggi." + +#: Stephanie/Modules/facebook_module.py:80 +msgid "birthday.friends.today" +msgstr "I tuoi amici con i compleanni oggi sono" + +#: Stephanie/Modules/facebook_module.py:81 +msgid "join.and" +msgstr " e " + +#: Stephanie/Modules/facebook_module.py:83 +msgid "birthday.none.today" +msgstr "Nessuno dei tuoi amici ha un compleanno oggi." + +#: 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/Modules/facebook_module.py:110 +msgid "facebook.notifications.none" +msgstr "Non hai notifiche di Facebook." + +#: Stephanie/Modules/facebook_module.py:117 +#, python-brace-format +msgid "facebook.notifications" +msgstr "Hai {0} notifiche di Facebook." + +#: 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/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/Modules/gmail_module.py:122 +msgid "error.gmail.authentication" +msgstr "Mi dispiace, non sono autenticato per lavorare con Gmail." + +#: Stephanie/Modules/gmail_module.py:125 +msgid "gmail.unread.none" +msgstr "Non hai email non lette." + +#: 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." diff --git a/Stephanie/speeches/speak.mp3 b/Stephanie/speeches/speak.mp3 deleted file mode 100644 index b6f5124..0000000 Binary files a/Stephanie/speeches/speak.mp3 and /dev/null differ 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 diff --git a/config.ini b/config.ini index 6541682..19ef489 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 @@ -64,11 +65,6 @@ open_weather_map_api_key = zomato_api_key = oauth_access_token = -[LOGS] -start_text = Give me your command! -listened_success_text = Your command is my order! -listened_error_text = I beg your pardon, could you repeat your command once again? - [CORE] speech_filename = speak.mp3 speech_directory = speeches diff --git a/Index.py b/index.py similarity index 100% rename from Index.py rename to index.py