-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Issue 2120 - Fallback to 'en-us' when resource loading fails #2392
Conversation
When mycroft_skill.find_resource fails to load a resource for self.lang fall back to lang 'en-us' as most skills/resources are available in english by default. ==== Fixed Issues ==== MycroftAI#2120
When mycroft_skill.find_resource fails to load a resource for self.lang fall back to lang 'en-us' as most skills/resources are available in english by default. ==== Fixed Issues ==== MycroftAI#2120
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this,
just had a minor nitpick (see comment in code) otherwise it looks very good and mergable.
@@ -675,9 +675,22 @@ def find_resource(self, res_name, res_dirname=None): | |||
Returns: | |||
string: The full path to the resource file or None if not found | |||
""" | |||
result = self._find_resource(res_name, self.lang, res_dirname) | |||
if not result: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add and self.lang != 'en-us'
to this if-statement so it doesn't try to get English resources twice if the file is missing.
Tested some more and this doesn't handle dialogs but that might be outside the scope of the PR? |
Yes, dialogs |
I merged the commits needed to load the skills through #2411, I had some issues with the dialogs so we might need to go over those again. Thanks for contributing this and I hope the German experience improves (I know my Swedish experience will!) If you like to continue the work on dialog and .voc files we can discuss the issues further. In the mean time I'm closing this PR and you/we can move the last commit over to a new branch based on the latest dev branch to continue the work. Once more, many thanks. |
Description
When mycroft_skill.find_resource fails to load a resource for self.lang fall back to lang 'en-us' as most skills/resources are available in english by default.
==== Fixed Issues ====
#2120
How to test
There are several skills missing some intent-files for 'de-de' (among them is the mycroft-weather skill). Without this PR loading of these skills will fail. When PR is applied all skills will load, but some WARNINGs will be logged.
Contributor license agreement signed?
CLA [X] (Whether you have signed a CLA - Contributor Licensing Agreement