Open GoogleCodeExporter opened 9 years ago
0.9.8 is still affected.
Seems like "MessageFormat.format()" is the cause of it.
Original comment by azrad...@gmail.com
on 13 May 2014 at 9:55
The rules are a bit weird, but understandable.
If the string uses java-format, i.e. has a {0}
or similar, any '
needs to be double quoted, if it doesn't single quoting is required.
This is due to the way the MessageFormat works, where '
is used as a literal escape character.
I wouldn't call this a bug, since changing it (i.e. to escaping '
s used in java-format strings), would ruin any usages within the formatting block.
I have a patched version of the library, which simply uses the same logic for all strings. This to avoid having to treat strings differently in po files depending on whether there are arguments or not. With the proposed patch, all messages are treated "the MessageFormat way", i.e. apostrophes need to be escaped by doubling, even if the string contains no arguments.
If the maintainers like it, I would like of course to contribute the patch. I have the change in a branch of mine, and I have tested it through some external code. I'd like to also modify the unittests to ensure it, but I'm having unrelated issues with maven, so I didn't bother yet. Please let me know.
Original issue reported on code.google.com by
fnicola...@gmail.com
on 16 Oct 2012 at 9:53