[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ui-best-practices-working-group] How do you handle apostrophes?
- From: "Peter Mork" <stsmork@xxxxxxxxxxx>
- Date: Tue, 29 May 2007 06:19:29 +0000
- Delivered-to: firstname.lastname@example.org
I have a general question about the localization architecture of Eclipse (or
Java-based applications in general); please redirect me if this is not the
right forum to ask.
My question is this: how do handle the apostrophe character? It is
problematic for two reasons: first, the FormatMessage Java class treats it
as an escape character and therefore, messages that are passed to this class
must contain doubled apostrophes ('') instead of single ones ('). Since
translators have no idea whether a message is processed via FormatMessage or
not, they have no clue whether they should double their apostrophes or not.
The other problem is similar to this: if HTML output is generated via JSP
same problem again if the code uses constructs like this:
System.out.println("alert('" + bundle.getString(ALERT_MSG) + "');");
an apostrophe character. Again, the translator who is workin on the message
file (.properties or whatever format) only, would not know that the
apostrophe character needs to be written as \u0027 in this case.
Is there a generally accepted solution or best practice to tackle these
Express yourself instantly with MSN Messenger! Download today it's FREE!