[loc-en-dev] Error handling in LocaleBuilder and forLanguageTag
Naoto Sato
Naoto.Sato at Sun.COM
Fri Mar 6 09:48:32 PST 2009
Sorry, but the current link to 'forLanguageTag()' in the following page
is broken:
http://sites.google.com/site/openjdklocale/apis/locale
Thus I asked the first question.
Naoto
Yoshito Umaoka wrote:
> Naoto Sato wrote:
>> Folks,
>>
>> I have two comments as follows:
>>
>> - Locale.forLanguageTag(): Please describe how the lenient behavior
>> works in the spec. This should not be implementation dependent.
>
> * Returns a locale for the specified language tag string. If the
> * specified language tag contains any non-well-formed subtags, the
> first
> * such subtag and all following subtags are ignored.
>
> This is the current JavaDoc description. I think we'll just refer BCP47
> for subtag validation. Or, put the current BCP47 langtag BNF here. I
> actually think we should update the API doc for Locale class and explain
> the relationship with BCP47 language tag / what is
> well-formed/ill-formed and etc.
>
>>
>> - What happens with Builder.setLanguageTag(), if some other setXXX()s
>> are previously called and they conflict? Are they reset strictly to
>> setLanguageTag(), or superset tag is created, or an exception?
> Builder#setLocale and setLanguageTag will overwrite all fields. For
> example,
>
> new Builder().setRegion("US").setLanguageTag("en").create()
>
> will return Locale en, not en_US.
>
> -Yoshito
--
Naoto Sato
More information about the locale-enhancement-dev
mailing list