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>may I suggest you to put a breakpoint into the  LocaleMiddleware Class? </p>

<p>In this way, you might found out a clue which thing was actually getting your way from getting the right Language.</p>

<p>Becaue according the <a href="https://docs.djangoproject.com/en/1.10/_modules/django/middleware/locale/#LocaleMiddleware" rel="nofollow">source code</a> of LocaleMiddleware Class and the <a href="https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#how-django-discovers-language-preference" rel="nofollow">How Django discovers language preference</a>
, there could be so many things can affect the result.</p>

python django internationalization django-i18n