-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Translations do not work when run via cron #8412
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
Comments
Did you deploy the french language pack?
Thom |
Yes the email was correctly translated if sending asynchronously is disabled. |
I have the same problem. Temporarily resolved with the following solution: /**
* @var \Magento\Framework\App\AreaList
*/
private $areaList;
public function __construct(\Magento\Framework\App\AreaList $areaList) {
$this->areaList = $areaList;
}
private function execute() {
$areaObject = $this->areaList->getArea(\Magento\Framework\App\Area::AREA_ADMINHTML);
$areaObject->load(\Magento\Framework\App\Area::PART_TRANSLATE);
var_dump(__('Registered'));
} |
@reindert-vetter thanks for confirming. I have suggested a fix in this PR #8413 which is the same solution just on a higher level (cron not only the template). If you could confirm that my changes here https://github.com/magento/magento2/pull/8413/files also work for you that be great. |
Hallo, I have "solve" this issue with using \Magento\Store\Model\App\Emulation::startEnvironmentEmulation() function before sending and stopping after. |
Hi just reported in 2.4.5-p3 version Magento removed part translate from abstract template email controller part translate init Also i got experience crontab mail render seem not correct get phase translate (english still be used) |
Uh oh!
There was an error while loading. Please reload this page.
Preconditions
Steps to reproduce
composer require imaginaerum/magento2-language-fr-fr
bin/magento cron:run
is executing and that the order confirmation email has been sentExpected result
Actual result
Please note that the locale for email is correctly emulated as can be seen by formatting of the currency amounts.
The text was updated successfully, but these errors were encountered: