Developer forum

Forum » Ecommerce - Standard features » Translation Tags in Email notifications sent on Order State change

Translation Tags in Email notifications sent on Order State change

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I am trying to use Translations in the templates for the email sent on Order Status Change. It seems that the translations are ignored and they are not rendering anything.

I had to hardcode the text for now, but it's not helpful.

The solution is running DW 9.4.11.

Thank you,
Adrian


Replies

 
Nicolai Pedersen
Reply

Hi Adrian

There are no translations in that context since the emails are sent outside the context of the pageview which defines the translation culture - so it is currently not posible to use translation tags - how would it know which language to use?

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the explanation. It makes total sense, although I am not sure how I can explain it to the customer.

They want to control the message in there but I don't want to let them mess with those notifications.

I guess I have no alternatives.

Thank you,

Adrian 

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi guys (and Happy New Year!),

@Adrian you could apply a workaround if you have the order table column OrderCheckoutPageId filled in.
You can get the pageview (and then the culture info) from a page id and apply the translate like: Translate("key", "value", "cultureName")

BR, Mario

 
Mario Santos Dynamicweb Employee
Mario Santos
Reply

Hi guys (and Happy New Year!),

@Adrian you could apply a workaround if you have the order table column OrderCheckoutPageId filled in.
You can get the pageview (and then the culture info) from a page id and apply the translate like: Translate("key", "value", "cultureName")

BR, Mario

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Mario,

Sounds like a very good solution!

Thank you very much

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I have tried this approach but I cannot make it work.

I have managed to get the culture in the template. I have defined the Translate strings in the Translation XML.

But for some reason, the only value that I get is the one set in the template.

My translate looks like this:Translate("HeaderSectionOrderShipped","Potvrdenie o odoslaní objednávky","cs-CZ").

I have tried defining the translate tags in the Rapido translation XML as well as in the Shared XML.

@Mario: have you made it work before?

@Nicolai: is this even supposed to work?

Thank you,

Adrian

 
Nicolai Pedersen
Reply

Hi Adrian

No, it is not supposed to work as a I previously mentioned, translate is requiring a pageview instance. You might be able to use dynamicweb.rendering.translation namespace

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you.

I have missunderstood your silence after Mario's reply. I thought that supplying the culture might make it for the lack of PageView.

I will try the namespace you have suggested.

Thank you,
Adrian

 

You must be logged in to post in the forum