cancel
Showing results for 
Search instead for 
Did you mean: 

Translating transactional email Magento 2

SOLVED

Translating transactional email Magento 2

Hello,

 

I want to know how can translate correctly my subject emails.

 

The only way I found was modify template at theme, but with that way I just have one language option...

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Translating transactional email Magento 2

Ok, I found the "problem/solution".

 

Why the hell aren't you using the translate method at Magento core templates?

 

Original:

<!--@subject Your {{var store.getFrontendName()}} order confirmation @-->

 

My Solution:

<!--@subject {{trans "Your %store_name order confirmation" store_name=$store.getFrontendName() }} @-->

 

That works great!

View solution in original post

5 REPLIES 5

Re: Translating transactional email Magento 2

Ok, I found the "problem/solution".

 

Why the hell aren't you using the translate method at Magento core templates?

 

Original:

<!--@subject Your {{var store.getFrontendName()}} order confirmation @-->

 

My Solution:

<!--@subject {{trans "Your %store_name order confirmation" store_name=$store.getFrontendName() }} @-->

 

That works great!

Re: Translating transactional email Magento 2

I'm kinda running nuts but where the heck is the subject line of order_new, shippment_new etc. email templates?

 

The string should look like this, right? "Your %1 order confirmation" when its "Your %store_name order confirmation" in the mail template

Re: Translating transactional email Magento 2

It's too easy: "Your %store_name order confirmation","Ihre Bestellbestätigung von %store_name" Does the trick, thought in language files always %1, %2 would be used.

Re: Translating transactional email Magento 2

One last thing, here's a list of all the entries I couldn't find in any .csv files so I added them to my own. These should be all the subject lines for emails: http://pastebin.com/F2Bt61Ur

Re: Translating transactional email Magento 2

Hello,

 

I use magento 2.1.4 and I don't see the above string in the emails.

What I see is tat the strings started with {{trans "string... But how it will managed.

 

Can someone please explain it?

can someone explain to me how this works

 

Rob van Westrop