How to maintain different country versions of same language in Django?
<p>I would like to have a few different versions of the same language in Django, customized for different countries (e.g. <code>locale/en</code>, <code>locale/en_CA</code>, <code>locale/en_US</code>, etc.). If there is no language for specific country I would expect to use the default language version (<code>locale/en</code>)).</p>

<p>Then in the settings file for each site I specify <code>LANGUAGE_CODE</code> and <code>LANGUAGES</code>.</p>

<p>For some reason, even if I specify the following settings, the <code>locale/en_US</code> translations are still used:</p>

<pre><code>LANGUAGE_CODE = 'en'
LANGUAGES = (
    ('en', ugettext('English')),
)
</code></pre>

<p>Though I clearly specify that the language code should be <code>en</code> (not <code>en-us</code>).</p>

<p>Am I missing something? Already tried to find the answer in multiple places, including Django documentation.</p>

<p>This is a quirk of Python (not specifically Django) and the gettext module.</p>

<p>Ticket <a href="https://code.djangoproject.com/ticket/8626" rel="nofollow">8626</a> was raised on the Django issue tracker around the time of the 1.0 release and after some suggestions and debate, the Django devs deemed it a "won't fix".</p>

<p>There are suggestions in the ticket thread to use 'en-en' as the default. My memory is a little rough but if I recall correctly this approach didn't play well with other parts of my i18n tooling (e.g. the pox library). I gave up and settled for using en-US as the default for the project and listing the other variants (e.g. en-au) as alternatives.</p>

python django internationalization django-i18n