Open murraycu opened 9 years ago
Actually, maybe I just shouldn't do this. This documentation http://developer.android.com/guide/topics/resources/string-resource.html under "Escaping apostrophes and quotes" says that "XML encodings" don't work.
Here's a bug report/question about those extra quotes when not escaping the markup: https://github.com/miracle2k/android2po/issues/31
If my strings.xml has a string such as this:
Then the strings.pot file (and the strings-*.po files) contains this:
These lt, gt and quot entities are entirely specific to XML so I wouldn't expect to see them in the .po file for translators to see.
I think there are at least some cases (full HTML to show in an HTML view?) where people really need to correctly escape their markup in strings.xml.
This could get awkward because Android also accepts unescaped markup in strings.xml, in which case it seems to parse the resulting child nodes and pretend that nothing odd happened. And that's actually the only way to have an a link in your TextView's text when specifying the text via the layout XML, so I have to set these in code via Html.fromHtml(getString(R.string.something)).
I actually started using the correct XML escaping in my strings.xml because a2po adds quotes around the strings when importing them back into strings.xml. Android seemes to ignore them, but it seemed odd and I considered it a bug in my strings.xml ratherr than a problem with a2po.