Since DateTime::Locale was updated in connection with the NewHost move, it produces locale identifiers using a hyphen to separate parts instead of the previous underscore. (E.g., Switzerland German now uses de-CH instead of de_CH.) This causes a number of problems:
- Different spellings of the same locale appear in the database, confusing our code as well as potentially data users.
- Locales with multiple parts are no longer identified correctly for indentation purposes. (
- The language selector didn’t show the names for multi-part locales. (
- When trying to edit an alias with a multi-part locale, an empty locale is shown instead of the existing one. This may lead to editors inadvertently removing a locale; if the alias happens to be primary for the locale, editing fails (because an alias with an apparently empty locale can’t be primary).
We need to make this consistent again, using either hyphen or underscore everywhere. For the following reasons, I think we should revert to the underscore:
- It is what we used before, so this requires minimal changes for us and none for data users.
- While both forms are valid for CLDR/Unicode locale identifiers, the underscore is apparently preferred.
- It helps to avoid confusion with BCP-47 tags, which are similar but not identical, and which use the hyphen exclusively.