[loc-en-dev] [Fwd: Updated JavaDoc]
y.umaoka at gmail.com
Tue Mar 3 13:56:47 PST 2009
Yoshito's comments in this color.
> Forwarding additional comments from Mark Davis below -
> More comments:
> public java.lang.String *getDisplayName*(Locale <http://sites.google.com/site/java/util/Locale.html> inLocale)
> Returns a name for the locale that is appropriate for display to
> the user. This will be the values returned by
> getDisplayLanguage(), getDisplayCountry(), and getDisplayVariant()
> assembled into a single string. The display name will have one of
> the following forms:
> language (country, variant)
> language (country)
> language (variant)
> country (variant)
> => The display name will typically have one of the following forms.
> However, localized versions may have combined names (eg "American
> English") or used other punctuation or ordering.
The immediate requirement for now is to decide how to add script
information if available (or not?). We probably revisit generic display
format pattern issue after JDK7.
> public Locale.LocaleBuilder <http://sites.google.com/site/java/util/Locale.LocaleBuilder.html> *setLocale*(Locale <http://sites.google.com/site/java/util/Locale.html> loc)
> New API Sets the locale to this builder.
> |loc| - the locale
> Sets the locale in this builder. Replaces all fields: thus new
> In general, "Sets the X to this builder. " should be "Sets the X field
> in this builder. "
We still have a design question open for this method. If the given
Locale has any fields which do not meet the BCP47 syntax requirement, we
have several options -
1. Leave it as is. If you call createStrict() later and the field was
not overridden by another setXXX call, return null (error).
2. Ignore fields which do not support the BCP47 syntax requirement. As
the result, createStrict() does not produce any errors. The malformed
field is simply ignored.
3. Do canonical mapping first in setLocale call, then if the syntactical
issue still remains, 1 or 2 above.
new LocaleBuilder.setLocale(new Locale("ja", "JP", "JP")).createStrict()
returns locale ja_JP for option 1, null for option 2, ja_JP_ca_japanese
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the locale-enhancement-dev