- First make sure that you do Update Language/Script/Region Subtags first
- Run GenerateLikelySubtags with VM argument
-DCLDR_DIRset to your cldr directory to generate the likely subtag data AND the default content locales.- If you are trying to debug, add the VM argument
-DGenerateLikelySubtagsDebug
- If you are trying to debug, add the VM argument
- Input data:
- Data comes from territory/language information in supplemental data.
- However, it is supplemented by LANGUAGE_OVERRIDES in GenerateLikelySubtags.java
- If there is no territory/language information in supplemental data for a language, add it to LANGUAGE_OVERRIDES.
- If the mapping changes when it shouldn’t (there are some special cases), add to LANGUAGE_OVERRIDES.
- However, it is supplemented by LANGUAGE_OVERRIDES in GenerateLikelySubtags.java
- Data comes from territory/language information in supplemental data.
- Output:
- Creates {CLDR_DIR}/../Generated/cldr/supplemental/likelySubtags.xml and {CLDR_DIR}/../Generated/cldr/supplemental/supplementalMetadata.xml
- Diff with {CLDR_DIR}/common/supplemental/likelySubtags.xml and {CLDR_DIR}/common/supplemental/supplementalMetadata.xml
- Be very careful to diff everything and check for errors.
- Watch especially for backwards incompatible changes; that is, changes rather than just additions.
- Look at the above to handle that with LANGUAGE_OVERRIDES.
- Run tests, fix input data, and iterate as necessary.
- Copy into the svn workspace and commit.
Updating langtags.json
langtags.json is used as an additional source for likely subtag information.
To update:
- Go to https://github.com/silnrsi/langtags/releases/latest and find the latest release
- Download
langtags.jsonand copy it to./tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/external/langtags.json - Check git diff - if there’s no change, you’re done.
- Re-run
GenerateLikelySubtags(just as in the above section) - If there are no changes to
likelySubtags.xml, then just check inlangtags.jsonand note that. - diff the results, run tests, check in, etc. (see above)
- Note: You can use the
--jsoncommand line option toGenerateLikelySubtagsto get detailed warnings aboutlangtags.json
Example update to likelySubtags.xml: (note the origin= attribute)
+ <likelySubtag from="aci" to="aci_Latn_IN" origin="sil1"/> <!--Aka-Cari‧?‧? ➡ Aka-Cari‧Latin‧India-->
+ <likelySubtag from="ack" to="ack_Latn_IN" origin="sil1"/> <!--Aka-Kora‧?‧? ➡ Aka-Kora‧Latin‧India-->
+ <likelySubtag from="acl" to="acl_Latn_IN" origin="sil1"/> <!--Akar-Bale‧?‧? ➡ Akar-Bale‧Latin‧India-->