Language tag matching supports IETF / RFC 5646 / BCP 47 tag formats as implemented by MkvMerge.
Tags are in the form of language-extlang-script-region-variant-extension-privateuse, and matching happens left to right (most specific to least specific).
Examples:
ptmatches:ptPortuguese,pt-BRBrazilian Portuguese,pt-PTEuropean Portuguese.pt-BRmatches: onlypt-BRBrazilian Portuguese.zhmatches:zhChinese,zh-Hanssimplified Chinese,zh-Hanttraditional Chinese, and other variants.zh-Hansmatches: onlyzh-Hanssimplified Chinese.
During processing the absence of IETF language tags will be treated as a track warning, and an RFC 5646 IETF language will be temporarily assigned based on the ISO639-2B tag.
If ProcessOptions.SetIetfLanguageTags is enabled MkvMerge will be used to remux the file using the --normalize-language-ietf extlang option, see the MkvMerge documentation for more details.
Normalized tags will be expanded for matching.
E.g. cmn-Hant will be expanded to zh-cmn-Hant allowing matching with zh.
- See the W3C Language tags in HTML and XML and BCP47 language subtag lookup for technical details.
- Language tag matching is implemented using the LanguageTags library.