Match extlang subtags

If the second subtag of a BCP 47 tag is three letters long, it denotes
an extended language. The tag converter ignores the language subtag and
uses the extended language instead.

There are some grandfathered exceptions, which are handled earlier.
This commit is contained in:
David Corbett authored and Behdad Esfahbod committed 2018-10-11 13:54:28 -04:00
1 parent 2f1f961cc0
commit 7c7cb2a989
4 files changed
+38 -2

No files matched your search

+7
View File
@@ -369,9 +369,13 @@ test_ot_tag_language (void)
test_tag_from_language ("ABC", "xyz-xy-x-hbotabc-zxc");
/* Unnormalized BCP 47 tags */
test_tag_from_language ("ARA", "ar-aao");
test_tag_from_language ("JBO", "art-lojban");
test_tag_from_language ("KOK", "kok-gom");
test_tag_from_language ("LTZ", "i-lux");
test_tag_from_language ("MNG", "drh");
test_tag_from_language ("MOR", "ar-ary");
test_tag_from_language ("MOR", "ar-ary-DZ");
test_tag_from_language ("NOR", "no-bok");
test_tag_from_language ("NYN", "no-nyn");
test_tag_from_language ("ZHS", "i-hak");
@@ -379,6 +383,9 @@ test_ot_tag_language (void)
test_tag_from_language ("ZHS", "zh-min");
test_tag_from_language ("ZHS", "zh-min-nan");
test_tag_from_language ("ZHS", "zh-xiang");
/* A UN M.49 region code, not an extended language subtag */
test_tag_from_language ("ARA", "ar-001");
}
static void