"However, historically our code just added together the language string 'en' and the country string 'DK' to get 'en_DK' - since that wasn't in the database it was just added.
Later we made it so that it would not add new languages but rather come up with a realistic fallback - ie 'en_US' since that is the language we actually send emails in."
Based on the ticket https://phabricator.wikimedia.org/T321251 we seems no longer add the new invalid made up locale, while when we are getting the en_xx cleaned up, we are stilling seeing a lot new invalid locales coming up
MariaDB [civicrm]> select is_deleted, count(*) FROM civicrm_contact WHERE preferred_language like "en_%" and preferred_language not in ('en_US', 'en_AU', 'en_ZA', 'en_GB', 'en_CA') group by is_deleted;
| is_deleted | count(*) |
| 0 | 9071 |
| 1 | 520711 |
2 rows in set (43.845 sec)
need to find out where are those coming from and then unblock the T321251, otherwise those five character locale data could never get cleaned up.