-
Notifications
You must be signed in to change notification settings - Fork 9.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
Update DataProvider.php #8217
Update DataProvider.php #8217
Conversation
Some template files from extensions cause the js-translation.json file to contain an empty array. The try-catch block prevents this and will just exclude that specific file from the loaded language strings, since it's almost impossible to debug which file is causing this.
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 please log the Exception, so that the issue with the improper template will be flagged to the developer
@redelschaap Thanks for contribution, please see comment above |
@vrann I've made some changes. |
@@ -109,6 +109,8 @@ public function getData($themePath) | |||
$dictionary[$phrase] = $translatedPhrase; | |||
} | |||
} catch (\Exception $e) { | |||
throw new \Exception(sprintf('Error while translating phrase "%s" in file %s.', |
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.
Please use \Magento\Framework\LocalizedException (or create subclass of it)
@redelschaap Thanks! Added one more comment. And please fix static test failed in Travis. |
@vrann I updated the code. I cannot fix the issue in Travis since those issues are out of the scope of my adjustments. |
@redelschaap changes look good.
Can you please fix those? |
Made the adjustments, Travis still failed but that is out of my scope:
|
@redelschaap thanks, that was everything needed |
@redelschaap thank you for your contribution to Magento 2 project. Your PR is successfully merged to develop branch |
…2-cia-2.4.7-beta1-bugfixes-02062023 Revert "Revert "Cia 2.4.7 beta1 bugfixes 02062023""
Some template files from extensions cause the js-translation.json file to contain an empty array. The try-catch block prevents this and will just exclude that specific file from the loaded language strings, since it's almost impossible to debug which file is causing this.