Magento – Magento 2: order email does not translate

email-templatesemail-translationmagento2order-email

  • I am working with Magento version 2.0.7. I set up the de_DE.csv file in my own theme and put all the translation text for email into this CSV file.

  • However, when I try to create a new order and receive an email. The order email is always in English text.

  • Other emails (new account, forgot password ..) are still in correct German text.

Does anyone have the same problem like me and already found the solution. Can you give some advises?

Best Answer

When an email is sent via cron or from CLI - need to make sure that the Translate Area Part is loaded. For me the following piece of code has helped (I used it right before the email message template content is prepared):

//do not use object manager directly. this is only for the demonstrating purpose.
$o = \Magento\Framework\App\ObjectManager::getInstance();

/** @var \Magento\Framework\App\AreaList $areaList */
$areaList = $o->get(\Magento\Framework\App\AreaList::class);
$areaList->getArea(\Magento\Framework\App\Area::AREA_FRONTEND)
        ->load(\Magento\Framework\App\Area::PART_TRANSLATE);`
Related Topic