Name: dbT83986 Date: 11/20/99
java version "1.2.2"
Classic VM (build JDK-1.2.2-U, native threads, symcjit)
In Internationalization, the Java tutorial
http://java.sun.com/docs/books/tutorial/i18n/index.html
recommends using java.util.PropertyResourceBundle files to contain
constant strings of localized messages.
It recommends using java.text.MessageFormat to format messages
containing variable data. It recommends storing the message format
string for variable data in the Properties file accessed by the
PropertyResourceBundle.
For constant strings accessed by java.util.ResourceBundle.getString,
single quotes (') have no special meaning and are returned as is, and
do not need to be treated specially in the properties file.
For MessageFormat pattern strings, single quote is a special character,
and is used to quote braces in pattern strings.
From the point of view of the localization person (translator), this
presents a problem, because in a properties file sometimes single
quote is left alone and sometimes it must be doubled.
I realize that this is a result of interaction between two different
parts of the Java class libraries, but they are parts that are designed
to work together, and the emergent property of using them together
is a screw case.
I realize that it is too late to change the API for MessageFormat for
quoting rules, but it may be possible for you to fix this in the future,
or at least document it in the tutorial and the extensive API documentation
on PropertyResourceBundle and MessageFormat.
(Review ID: 98087)
======================================================================
- duplicates
-
JDK-4321513 {0} appearing literally in .java files during CD0 or Suninstall
-
- Closed
-
-
JDK-4432881 MessageFormat fails to perform substitution
-
- Closed
-
-
JDK-4839037 MessageFormat doesn't replace {0} if followed by word with apostrophe
-
- Closed
-
- relates to
-
JDK-6983207 API: MessageFormat quote handling discrepancy
-
- Closed
-