Laurent Blume wrote:
Alan Burlison a écrit :
As a generalisation it is error and warning messages that get the
double-quotes stripped as they pass through Java's MessageFormat class,
but some others do as well.  It's a pain, I'll see if I can think of a
solution. It might also help a little if the CTI tool gave the labels as well as the text. You can see the current versions of the master and translated files in the Auth repo - see http://src.opensolaris.org/source/xref/website/oso/auth/AuthWebapp/src/configuration/

I recently experienced the quote/apostrophe issue of java .properties in
other project. The suggestion I got was that if a message has arguments
(place holders) such as {0), the msg is passed through MessageFormat class.
Then a single apostrophe in this msg must be duplicated. Otherwise,
the single apostrophe will not be displayed and also it will cause
the argument to not work. For example,

OK=I was born at my mother''s house in {0}.
output ==>
   I was born at my mother's house in Japan.

NG=I was born at my mother's house in {0}.
output ===>
   I was born at my mothers house in {0}.

And if a msg doesn't have arguments, we can assume the MessageFormat class
is not used. Then, use a single apostrophe. If it's duplicated, you will
see the duplicated apostrophes in actual output.

The above assumption may not be 100% sure, but should work most cases.

Well, CTI introduces further issue...
CTI will split a single msg into plural segments by sentence delimiter
such as '.', '?'. For example, the msg below

OK=I was born at my mother's house. The mother's house was in {0}.

will be split into the following two segments.

I was born at my mother's house.
The mother's house was in {0}.

In this case, the apostrophe in the former segment also needs to
be duplicated. However, this can not be detected without referring
actual message src file, or CTI needs to be able to show msg key
information or stop splitting into plural segments for .properties.

Thanks,
Fuyuki

_______________________________________________
website-discuss mailing list
[email protected]

Reply via email to