commerceguys / intl

A PHP internationalization library, powered by CLDR data.
MIT License
361 stars 45 forks source link

Improve locale parenting #45

Closed bojanz closed 6 years ago

bojanz commented 6 years ago

Our locale parent logic is simple. "en" is the parent of "en-US". Locale::getCandidates() and the generate.php scripts have that logic.

CLDR specifies grouping locales such as es-419 and en-150 that we currently don't even generate. If we used them, we'd have more precise parent-child matching and we'd probably be able to exclude more child locales.

Full list at: https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/parentLocales.json