Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Padatious intent handler registration with multiple native languages #148

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,17 +1256,17 @@ 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:
self.log.error(f'Unable to find "{intent_file}"')
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):
"""
Expand Down
Loading