From ad9b0c261ee4380132e600d72de3f62c3eebbcac Mon Sep 17 00:00:00 2001 From: Daniel McKnight <34697904+NeonDaniel@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:37:59 -0800 Subject: [PATCH] Fix Padatious intent handler registration with multiple native languages (#148) Co-authored-by: Daniel McKnight --- ovos_workshop/skills/ovos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ovos_workshop/skills/ovos.py b/ovos_workshop/skills/ovos.py index 51a77f42..5b1c00a8 100644 --- a/ovos_workshop/skills/ovos.py +++ b/ovos_workshop/skills/ovos.py @@ -1256,8 +1256,8 @@ def register_intent_file(self, intent_file: str, handler: callable): '.intent' handler: function to register with intent """ + name = f'{self.skill_id}:{intent_file}' for lang in self.native_langs: - name = f'{self.skill_id}:{intent_file}' resources = self.load_lang(self.res_dir, lang) resource_file = ResourceFile(resources.types.intent, intent_file) if resource_file.file_path is None: @@ -1265,8 +1265,8 @@ def register_intent_file(self, intent_file: str, handler: callable): continue filename = str(resource_file.file_path) self.intent_service.register_padatious_intent(name, filename, lang) - if handler: - self.add_event(name, handler, 'mycroft.skill.handler') + if handler: + self.add_event(name, handler, 'mycroft.skill.handler') def register_entity_file(self, entity_file: str): """