SOLVED - Translation strings and HTML codes

Hi. Me and my team are currently testing Dolibarr for a possible implementation. I’m located in Mexico, therefore I’m using the interface translated into Spanish. From time to time we found some untranslated strings that get promptly translated by using the in-app translation module (Setup -> Translation); but we found a problem when we try to process strings with embedded html (usually a link), for instance: “Only elements from <a href="%s">enabled modules</a> are shown.” (with the associated key OnlyActiveElementsAreShown). When we try to translate these kind of strings, then the app shows an error if we include the html tag characters (i.e. <, >, /), as if we didn’t enter any translated text:

Capturadepantalla2018-10-08alas0.49.56.png

So, we tried the translation by entering escaped strings, which allowed us to save the new translation without any errors, but the issue with that approach is that the resulting page shows the literal escaped string and those html tags aren’t rendered as html code at all:

So, my question is: how can such strings be translated? We’re supposing that by modifying the /lang/es_MX files we could get the expected result (including the html code as it is), but we would like to use the in-app service to get results faster.

Thanks in advance!

I just found out what caused the problem: the translated strings should not include double quotes. I just replaced them with single quotes and the translation tool allowed me to save the proposed string (without any escaping) and the resulting html rendered as expected.

:wink: