Skip to main content
Formatting accepts bounded language/script/region/variant locale IDs with RFC5646 extension groups and private-use tails attached to a language. Both separators are accepted; browser tags use hyphens and PHP IDs use underscores:
A missing exact translation drops the complete extension block before trying region/script/variant parents. No dangling en_US_u or partial extension becomes a translation candidate. Explicit scripts determine direction (ar-Latn is LTR). FamilyRenderContext uses the same locale admission as ordinary formatting. Duplicate extension singletons, empty extension values, malformed variants and oversized IDs reject. The syntax contract does not bundle the IANA/Unicode registries or claim every calendar/numbering option exists in the installed ICU or browser. Grandfathered tags, extlang forms and private-use-only locale IDs remain unsupported. See RFC5646.

Continue reading

Extension guides · Definition and registration reference
Last modified on October 17, 2026