DrLightman Posted June 5, 2012 Share Posted June 5, 2012 Hi, I'd like to enclose a word of a translated string between strong tags, but the tags are printed as is on the frontend, I suppose htmlspecialchars() is used for the output. So I guess there is no way to insert html code in a translation text? 1 Link to comment Share on other sites More sharing options...
ink_ru Posted November 20, 2012 Share Posted November 20, 2012 (edited) It's interestign for me too! Edited November 20, 2012 by ink_ru (see edit history) Link to comment Share on other sites More sharing options...
sebastien.pacilly Posted January 20, 2013 Share Posted January 20, 2013 In prestashop 1.5 Modify the file : /controllers/admin/AdminTranslationsController.php Replace the following line (line 814) $str_write .= '$_MODULE['.$pattern.'] = \''.pSQL(str_replace(array("\r\n", "\r", "\n"), ' ', $_POST[$post_key])).'\';'."\n"; by $str_write .= '$_MODULE['.$pattern.'] = \''.pSQL(str_replace(array("\r\n", "\r", "\n"), ' ', $_POST[$post_key]), true).'\';'."\n"; Adding "true" to the pSQL function. Hope it help. Link to comment Share on other sites More sharing options...
tomerg3 Posted January 20, 2013 Share Posted January 20, 2013 Do not modify anything, that is a really bad idea, and a bad solution. Simply don't use any <tags> in a translation function, just the text on the inside. IE {l s='Some text'} <strong>{l s='Some text in BOLD'}</stong> {l s='some more text....'} 1 Link to comment Share on other sites More sharing options...
sebastien.pacilly Posted January 27, 2013 Share Posted January 27, 2013 Hi Tomerrg3, I undestand what you mean but is not realy useful. Every time we want to add/modify some <tags> we have to change the template file and some times the administartor/editor have no knowledge or basic knowledge about development. It's why I prefer let them adding <tags> from the backoffice. I don't know if it's already possible to have a tinyMCE in a translation page but will be very useful. Link to comment Share on other sites More sharing options...
El Patron Posted January 27, 2013 Share Posted January 27, 2013 (edited) if you are going to go about it then try css and not html, your .tpl that can be modified from your translation, for example: This would be inserted in your .tpl file. Now from the back office you can by language modify your class some-text <div class=\"some-text\" style=\" {l s='font-family: inherit;'} {l s='margin-top: 20px;'} {l s='margin-right: 10px;'} {l s='margin-bottom: 0px;'} {l s='margin-left: 0px;'} {l s='line-height: 1;'} {l s='float: left;'} {l s='z-index: 1;'}\"> </div>"; then your back office translation look's like this, (which you can now easily modify). http://screencast.com/t/QcKGXGFw Edited January 27, 2013 by elpatron (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts