Is there a table of locales?

All of the alias tables have a locale, as opposed to an area. And I see that for some Japanese locales, it specifies the writing method.

Someone should correct me if I’m wrong, but it looks like the canonical list lives in the musicbrainz-server repo at root/static/scripts/common/constants/locales.json.

2 Likes

So it’s not in the database? It’s hardcoded? Wow. Thanks for finding it for me.

I suspect that these are just locales from the DateTime::Locale Perl package, which gets them from the Unicode CLDR.

1 Like

Yes, that’s exactly right. Unlike languages and scripts which we maintain ourselves, alias locales come from the CLDR. We generate the locales.json file referenced above (which is used by our JavaScript code) from DateTime::Locale (which is used by our Perl code) so that the JavaScript and Perl are consistent in working with the exact same list of locales–whichever version of the CLDR DateTime::Locale is currently pinned to (AFAICT, we’re using 1.41 in production, which is based on CLDR 44.1.0).

2 Likes