Closed Bug 34954 Opened 26 years ago Closed 26 years ago

Need a mechanism to convert (language, country) pair to accept-lang

Categories

(Core :: Internationalization, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: tao, Assigned: tao)

Details

(Whiteboard: [nsbeta2+] patch ready for review...)

In certain language tags used in Accept-Language, the country code are often omitted. We need a mechanim to convert them back and forth to the uniform language-country pair to match the current locale name pair used under chrome directory and the (Language, Country) information gathered during Activation process. An alternative would be to allow the omission of the country code...
I don't think we will have any solution to "convert back and forth"
Assignee: ftang → bobj
How about using a table like the locale alias to map a given key to a value. For example, in a property file: # if country code is omitted. ja=ja-JP ja-JP=ja en=en-US When the country code is omitted, pass lang to get lang-COUNTRY. When both present, pass lang-COUNTRY to get lang. Of course, this is a quick hack and the caller needs to know what he needs. A pair of sample APIs are getPairByLang(lang); getLangByPair(pair); Also, we need to pre-populate the table with a list of locale supported by NetCenter. Comments? Reassign to myself
Assignee: bobj → tao
Target Milestone: --- → M16
Status: NEW → ASSIGNED
These bugs are prerequisites of our beta2 localization plan. Add "beta2" to keyword.
Keywords: beta2
We are using "intl.content.langcode" to hold the lang-country info from the Activation UI for now. Therefore, we won't need this bug fix in the near future. Will close this bug if we decide to use this pref instead of accept-lang. Move to M18.
Target Milestone: M16 → M18
Keywords: nsbeta2
During Activation, we collect the language and country info from users. For Japanese users in Japan, the language code pair, "language-country", would be "ja-JP". However, some web servers recognize Japanese locale as "ja" only (omitting the country code, "JP"). If we use "ja-JP" to update the user's Accept-Lanugage prefs, the user won't get correct Japanese content from certain web servers. Therefore, we need to convert "ja-JP" to "ja" and use "ja" to update the Accept-Language.
Keywords: beta2
marking nsbeta2+ per pdt.
Whiteboard: [nsbeta2+]
Target Milestone: M18 → M16
Whiteboard: [nsbeta2+] → [nsbeta2+] patch ready for review...
fix checked in. IQA, Please contact me for verifying the bug. I don't have the test JS script checked in. Thanks
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
changing QA contact to Tao
QA Contact: teruko → tao
Verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.