I’m getting ready to release some translations for my Django app. I noticed that the LANGUAGE_CODE follows the RFC standard. However, there’s something amiss with the LANGUAGES setting. I also noticed that the standard capitalizes US, which is not what Django is shipping with.
My LANGUAGE_CODE is ‘en-US’; however, the default LANGUAGES setting shipped with Django does not have a reference to ‘en-US’. What is the rationale for this decision? Maybe I’m confused about how the LANGUAGE_CODE and LANGUAGES settings work with each other.
Django will use the most specific language available, as you can see in the get_supported_language_variant function.
My American based assumption is that things usually start out in en-US and is the most popular dialect of the 13 English language dialects defined, so that’s the default English language translation, meaning less maintenance to have to maintain both en and en-US.
When looking at LANGUAGES, you can see that other languages also fall to just the base for some other language dialects such as ar (Arabic) and es (Spanish) as well.