[loc-en-dev] [Fwd: Updated JavaDoc]
Yoshito Umaoka
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:
>
>
> getDisplayName
>
> 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)
>
> language
>
> 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.
>
> setLocale
>
> 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.
>
> *Parameters:*
> |loc| - the locale
>
>
> Sets the locale in this builder. Replaces all fields: thus new
> LocaleBuilder().setLocale(loc).create().equals(loc).
>
> 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.
For example,
new LocaleBuilder.setLocale(new Locale("ja", "JP", "JP")).createStrict()
returns locale ja_JP for option 1, null for option 2, ja_JP_ca_japanese
for 3.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/locale-enhancement-dev/attachments/20090303/5456693d/attachment.html
More information about the locale-enhancement-dev
mailing list