TransWikia.com

Magento2- Email template not being translated

Magento Asked by Petar Borisovski on December 23, 2020

I have created a custom email template, all works well everything is shown, except when I use the trans dictionary to translate a string from English to German, the translation does not seem to work.

I have provided a de_DE.csv file but still the text it not being translated. Cleared cache, reindexed.

3 Answers

Magento 2 Translation in Custom Email Template
For Example:

{{trans "Shipping Info"}}

First, create a CSV file in your theme with the name de_DE.csv

app/design/frontend/[Your_Vendor]/[Your_Theme]/i18n/de_DE.csv

Add your English and DE translation text in the double quote like below:

Use for Email:

"Shipping Info","Lieferadresse",module,Magento_Email

Use for the Whole website:

"Shipping Info","Lieferadresse"

Answered by Vikram Kumar on December 23, 2020

For Email template translate string in m2 you need to wirte code like this.

{{trans "%items are shipping today." items=shipment.getItemCount}}

and when you check in browser, you need to clear cache and local storage from Broswer. http://prntscr.com/r02pu4

Answered by Bharat Desai - Certified Dev on December 23, 2020

it's mistake, used : instead of , in the csv file.

Answered by Petar Borisovski on December 23, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP