diff --git a/mycroft/listener/mic.py b/mycroft/listener/mic.py index 42478003800..fc8ff2d1b3c 100644 --- a/mycroft/listener/mic.py +++ b/mycroft/listener/mic.py @@ -51,7 +51,7 @@ from ovos_config.locations import get_xdg_data_save_path from mycroft.util.audio_utils import play_audio_file from ovos_plugin_manager.vad import OVOSVADFactory -from ovos_utils.messagebus import get_message_lang +from ovos_bus_client.util import get_message_lang WakeWordData = namedtuple('WakeWordData', ['audio', 'found', 'stopped', 'end_audio']) diff --git a/mycroft/skills/intent_service.py b/mycroft/skills/intent_service.py index cd3f987cde4..b6f99e4690b 100644 --- a/mycroft/skills/intent_service.py +++ b/mycroft/skills/intent_service.py @@ -28,7 +28,7 @@ from mycroft.util.log import LOG from mycroft.util.audio_utils import play_error_sound from mycroft.util.parse import normalize -from ovos_utils.messagebus import get_message_lang +from ovos_bus_client.util import get_message_lang from ovos_bus_client.session import SessionManager @@ -286,6 +286,8 @@ def handle_utterance(self, message): """ try: lang = get_message_lang(message) + sess = SessionManager.get(message) + sess.lang = lang # update session object try: setup_locale(lang) except Exception as e: diff --git a/mycroft/skills/intent_services/commonqa_service.py b/mycroft/skills/intent_services/commonqa_service.py index 7bd87d788eb..ca6c6923e3e 100644 --- a/mycroft/skills/intent_services/commonqa_service.py +++ b/mycroft/skills/intent_services/commonqa_service.py @@ -9,7 +9,7 @@ from mycroft.skills.skill_data import CoreResources from ovos_utils.enclosure.api import EnclosureAPI from ovos_utils.log import LOG -from ovos_utils.messagebus import get_message_lang +from ovos_bus_client.util import get_message_lang EXTENSION_TIME = 10 diff --git a/mycroft/skills/intent_services/converse_service.py b/mycroft/skills/intent_services/converse_service.py index 591a0138ecc..26534f6592b 100644 --- a/mycroft/skills/intent_services/converse_service.py +++ b/mycroft/skills/intent_services/converse_service.py @@ -95,10 +95,15 @@ def activate_skill(self, skill_id, source_skill=None, message=None): # also update default session if session.session_id != SessionManager.default_session.session_id: SessionManager.default_session.activate_skill(skill_id) + + if message: + msg = message.forward("intent.service.skills.activated", + {"skill_id": skill_id}) + else: + msg = Message("intent.service.skills.activated", + {"skill_id": skill_id}) # send bus event - self.bus.emit( - Message("intent.service.skills.activated", - {"skill_id": skill_id})) + self.bus.emit(msg) # update activation counter self._consecutive_activations[skill_id] += 1 @@ -250,6 +255,7 @@ def converse(self, utterances, skill_id, lang, message): handled (bool): True if handled otherwise False. """ session = SessionManager.get(message) + session.lang = lang state = session.utterance_states.get(skill_id, UtteranceState.INTENT) if state == UtteranceState.RESPONSE: session.update_history(message) diff --git a/mycroft/skills/mycroft_skill/mycroft_skill.py b/mycroft/skills/mycroft_skill/mycroft_skill.py index 1dc032109f8..3ca99b82485 100644 --- a/mycroft/skills/mycroft_skill/mycroft_skill.py +++ b/mycroft/skills/mycroft_skill/mycroft_skill.py @@ -60,7 +60,7 @@ from ovos_config.locations import get_xdg_config_save_path from ovos_utils.enclosure.api import EnclosureAPI from lingua_franca.parse import yes_or_no -from ovos_utils.messagebus import get_message_lang +from ovos_bus_client.util import get_message_lang import shutil # backwards compat imports, do not delete!