You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Localized property only supports ISO 639-1 format, which limits the ability to support different language regions (e.g., zh-TW and zh-CN) simultaneously. Navigator.language returns values in the RFC 5646 (BCP 47) format, which allows more specific language and regional tags. This discrepancy prevents a flexible localization setup that can support multiple variants of the same language, such as zh-TW (Traditional Chinese) and zh-CN (Simplified Chinese), which is important for applications targeting users in both Taiwan and Mainland China.
Suggest a solution
It would be great to extend the Localized property to support RFC 5646 (BCP 47) format, allowing it to handle language tags like zh-TW, zh-CN, and others that specify both language and region. This would enable better compatibility with modern browser behavior and allow localization to be more precise.
Additional context
Navigator.language and most modern web APIs return language tags in RFC 5646 format, which is more flexible than the ISO 639-1 standard.
Supporting RFC 5646 would also allow applications to serve different content based on both language and regional preferences, ensuring a more tailored user experience.
Key Code Section
The relevant code is located in ./l10n/l10n.js, which handles localization settings and language properties. Adjusting this logic to support RFC 5646 (BCP 47) format should allow multiple language variants to be used simultaneously.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Describe the problem to be solved
Currently, the
Localized
property only supports ISO 639-1 format, which limits the ability to support different language regions (e.g.,zh-TW
andzh-CN
) simultaneously.Navigator.language
returns values in the RFC 5646 (BCP 47) format, which allows more specific language and regional tags. This discrepancy prevents a flexible localization setup that can support multiple variants of the same language, such aszh-TW
(Traditional Chinese) andzh-CN
(Simplified Chinese), which is important for applications targeting users in both Taiwan and Mainland China.Suggest a solution
It would be great to extend the
Localized
property to support RFC 5646 (BCP 47) format, allowing it to handle language tags likezh-TW
,zh-CN
, and others that specify both language and region. This would enable better compatibility with modern browser behavior and allow localization to be more precise.Additional context
Navigator.language
and most modern web APIs return language tags in RFC 5646 format, which is more flexible than the ISO 639-1 standard.Key Code Section
The relevant code is located in
./l10n/l10n.js
, which handles localization settings and language properties. Adjusting this logic to support RFC 5646 (BCP 47) format should allow multiple language variants to be used simultaneously.The text was updated successfully, but these errors were encountered: