{"id":341,"date":"2019-03-15T11:47:32","date_gmt":"2019-03-15T11:47:32","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/2019\/03\/15\/translate-magento-2-email-templates\/"},"modified":"2025-05-22T17:02:41","modified_gmt":"2025-05-22T11:32:41","slug":"translate-magento-2-email-templates","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/translate-magento-2-email-templates\/","title":{"rendered":"How to Translate Magento 2 Email Templates"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Magento 2 is a widely used open source platform to build E-commerce stores. Therefore, the online stores built in Magento 2 offers a shopping platform to customers all over the globe. When serving such a huge mass, many factors must be taken into consideration, language being one of them!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every communication taking place between the store and the customer must be in the language that customer can understand. Otherwise, it may confuse them and the store may lose a sale.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generally, store owners use Emails to communicate with customers. Be it sales Email, newsletter, etc. By default, Magento offers Email templates in English language only. To overcome this limitation, here&#8217;s the code to <em><strong>translate Magento 2 Email templates<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Implement the below code in the Email template and the translated Emails will be sent to your customers in the language set in Magento 2 frontend.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here, the value passed in <strong>&#8220;trans&#8221;<\/strong> is translated. For example, the below code shows <strong>{{trans &#8220;hi&#8221;}}<\/strong> where the text &#8220;hi&#8221; is translated.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to translate Magento 2 Email templates:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Place the below code at <strong>[Vendor]\/[Module]\/view\/frontend\/email\/file.html<\/strong><br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{{template config_path=\"design\/email\/header_template\"}}\n&lt;!--@subject Thank You For Your Inquiry @-->\n&lt;!--@vars @-->\n&lt;table>\n    &lt;tr>\n        &lt;td>\n            &lt;table>\n                &lt;tr>\n                    &lt;td valign=\"top\">\n                        &lt;h1>{{trans \"Hi\"}} {{var name}},&lt;\/h1>   &lt;!-- here {var cname}} is variable name from template variable-->\n                    &lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;td>{{trans\n                        \"Thank you for contacting us. Your inquiry has been submitted successfully. We are looking into it and will contact you soon.\"}}\n                    &lt;\/td>\n                &lt;\/tr>\n                &lt;tr>\n                    &lt;td>\n                        &lt;center>\n                            &lt;p>\n                              &lt;strong>{{trans \"Thank you\"}}&lt;\/strong>\n                            &lt;\/p>\n                        &lt;\/center>\n                    &lt;\/td>\n                &lt;\/tr>\n            &lt;\/table>\n        &lt;\/td>\n    &lt;\/tr>\n&lt;\/table>\n{{template config_path=\"design\/email\/footer_template\"}}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s simple, isn&#8217;t? Use the above method to <em>translate Magento 2 Email templates<\/em>&nbsp;and easily send Emails without the language barrier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento 2 is a widely used open source platform to build E-commerce stores. Therefore, the online stores built in Magento 2 offers a shopping platform&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-341","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":15491,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/341\/revisions\/15491"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}