exadra37 Posted June 20, 2012 Share Posted June 20, 2012 When i use the translations tool, in back-office, to edit email templates, after save the changes, if i open the file in a text editor, i will see that all words with non English special characters will be encode as html entities... this is very annoying when you want to edit the file directly Before edit in back office the code in file is like this: <td align="left">Agora poderá fazer as suas compras e consultar as suas encomendas no nosso site: <a href="{shop_url}">{shop_name}</a>.</td> After edit (without make any change) and save in back office: <td align="left">Agora poderá fazer as suas compras e consultar as suas encomendas no nosso site: <a href="{shop_url}">{shop_name}</a>.</td> I think that is a bug, because it is not necessary to save as html entities, because prestashop use utf-8. The only problem is when we want to edit directly the file, because with or without html entities, encoding the special characters, the emails works fine . It is possible to turn off html entities encoding when emails translations are saved? Link to comment Share on other sites More sharing options...
exadra37 Posted June 21, 2012 Author Share Posted June 21, 2012 A find one workaround to fix this... In AdminTranslations.php at line 694 i find this code: $content = Tools::htmlentitiesUTF8($content); $content = htmlspecialchars_decode($content); and replaced by this one: $content = Tools::htmlentitiesDecodeUTF8($content); As you can see, by default, prestashop is encoding as html entities the content from email templates, and after just decode some characters. With the change i made, will always save the content without html entities, just save as utf-8 I don't see any difference in emails after this change... it seems to work fine, but if after i done more tests, i find any issue, i will post here 1 Link to comment Share on other sites More sharing options...
fransjaeger Posted February 12, 2015 Share Posted February 12, 2015 Thanks for sharing this. Im working on this now, and curious, how did go? Any issues? Link to comment Share on other sites More sharing options...
exadra37 Posted March 20, 2015 Author Share Posted March 20, 2015 Sorry for the delay in the reply... In the time this was done as part of a Freelancer job to fix several bugs in Shop and the client never more complaint about this, therefore i think no issues where caused by this change. Link to comment Share on other sites More sharing options...
Tommix Posted March 23, 2015 Share Posted March 23, 2015 (edited) 3 years passed, and prestaShop still have this bug. Now it encodes variable chars like { and } Edited March 23, 2015 by Tommix (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now