summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-06-16 20:40:13 -0700
committerAndrew Godwin <andrew@aeracode.org>2014-06-16 20:40:13 -0700
commitd359647715bccffd7cfc5eb8bcf5edb5c714fb00 (patch)
tree09b19ffc5f3ee9163111634823916e941ca0fa9e
parentb22917bd5062ad39ad9f00b121a4f6c6fa727a31 (diff)
Fixed #21498: Don't use a fallback language if you're en-us.
-rw-r--r--django/utils/translation/trans_real.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index dda2ab54c3..71445cb365 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -173,7 +173,11 @@ class DjangoTranslation(gettext_module.GNUTranslations):
def _add_fallback(self):
"""Sets the GNUTranslations() fallback with the default language."""
- if self.__language == settings.LANGUAGE_CODE:
+ # Don't set a fallback for the default language or for
+ # en-us (as it's empty, so it'll ALWAYS fall back to the default
+ # language; found this as part of #21498, as we set en-us for
+ # management commands)
+ if self.__language == settings.LANGUAGE_CODE or self.__language == "en-us":
return
default_translation = translation(settings.LANGUAGE_CODE)
self.add_fallback(default_translation)