encoding and html entities
Using special characters, accents and so on, generally works fine (as long as you properly set the character encoding of the files, of course), but if you would like to use html entities instead, you should "double code" the translation.ts file :
"é" should become "é"
"&" should become "&"
">" should become ">"
etc...
For example : if the string you would like to convert looks like
let's do it
and the source code of your template is
{"let's do it"|d18n()}
then the translation.ts should contain the following message :
<message>
<source>let&apos;s do it</source>
<translation>translated let&apos;s do it</translation>
</message>
It seems that ez Publish parses the html entities in the translation.ts file first before it actually compares the messages. I'm not sure why it actually performs that way, but it sure is something you should know about since the whole translation file can get rejected if it encounters quotes ( ' or " ), greater than ( > ) or smaller than ( < ) since the parsed file is no longer a valid XML file...
Comments (1 historical)
Written by readers of the earlier documentation sites, kept as they were.
Re: encoding and html entities
Saad ·
You can also use CDATA if needed to "escape" non-valid xml characters:
<message>
<source>Drink a coffee</source>
<translation><![CDATA[Boire un café]]></translation>
</message>