From 63e2e0231f601f7c20a5edef4b4afdee1628092e Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Sun, 17 Nov 2024 17:55:07 +0000 Subject: [PATCH] fix: register script aliases in all langs, not only in main one (#17) * fix: register script aliases in all langs, not only in main one in the future these should also be made translatable, but for now they should depend on the query language * add sound feedback * . --- __init__.py | 5 ++++- requirements.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 356a0a5..397d788 100644 --- a/__init__.py +++ b/__init__.py @@ -46,11 +46,13 @@ def initialize(self): for alias in self.alias: LOG.info(f"Adding script keyword: {alias}") - self.register_vocabulary(alias, 'Script') + for lang in self.native_langs: + self.register_vocabulary(alias, 'Script', lang=lang) @intent_handler(IntentBuilder('RunScriptCommandIntent') .require('Script').require('Run')) def run(self, message): + self.acknowledge() script = message.data.get('Script') script = self.alias.get(script, script) shell = self.settings.get('shell', True) @@ -63,3 +65,4 @@ def run(self, message): subprocess.Popen(args, shell=shell) except Exception: LOG.exception('Could not run script ' + script) + self.play_audio("snd/error.mp3", instant=True) diff --git a/requirements.txt b/requirements.txt index 9679af9..feda40d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -ovos-workshop>=0.0.15,<2.0.0 \ No newline at end of file +ovos-workshop>=0.0.15,<3.0.0 \ No newline at end of file