-
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
Load translations for area, fixes #8412 #8413
Load translations for area, fixes #8412 #8413
Conversation
e8344db
to
9601e69
Compare
Please note I added |
Travis failure is a timeout on Integration Tests1 on 5.6 - the same suite passes on 7.0 |
@fooman This is the solution! I tested it and it works for me. I hope this solution is implemented quickly! |
private function getAreaList() | ||
{ | ||
if ($this->areaList === null) { | ||
$this->areaList = $this->objectManager->get(\Magento\Framework\App\AreaList::class); |
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 injection via optional parameter in constructor instead of deprecated method, for example:
public function __construct(
\Magento\Framework\App\AreaList $arealist = null
) {
$this->arealist = $arealist ?: $this->objectManager->get(\Magento\Framework\App\AreaList::class);
}
@ishakhsuvarov requested changes are implemented |
#6511 could possibly also be fixed by this PR, have not had chance to test tho, sorry. |
@heldchen indeed looks like my issue report is a double up to the one you linked to, the suggested solutions are also very similar to the one I proposed |
@fooman Thank you for your contribution. Your pull request merged to develop branch |
For my custom cronjob it not works, i have to set correct locale store before load Area |
@LucScu thanks for your feedback. Just to confirm what do you mean by custom cron and have you applied the changes from this pull request? |
@fooman
Even if i set manually italian store in execute() method, translations are yet in en_US
To have translation in it_IT i have to set italian store in |
Have you tried wrapping your code into an emulated store similar to how Magento does when sending email? |
i try to investigate how email translations was managed and i found emulation logic, but i wasn't able to understand how apply it to my code. |
please follow up |
@LucScu please understand that this is not a forum to obtain support for custom code. You might have better luck on StackExchange. Generally you need to add Best of luck. |
@fooman sure i understand, but my custom code is related to your PR, i think it is helpful for all magento community. |
@fooman Did I missed something? |
After some research I found that only "Translation Cache" if is disabled emails works correctly. |
See #8412 for steps to reproduce.
Result