summaryrefslogtreecommitdiff
path: root/django/utils/translation/trans_null.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2018-05-11 15:59:31 +0430
committerTim Graham <timograham@gmail.com>2018-05-12 10:54:22 -0400
commitac59ec8f1a34ea0e82bdb3c77422694e8016e0a7 (patch)
treea1acea6ca45449c92471fd317b340b7e000c7ee9 /django/utils/translation/trans_null.py
parenta5a2ceeb453b86caaf01687342984f372428beb8 (diff)
Aliased trans_null.to_locale() to trans_real.to_locale().
The implementations have unintentionally diverged.
Diffstat (limited to 'django/utils/translation/trans_null.py')
-rw-r--r--django/utils/translation/trans_null.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/django/utils/translation/trans_null.py b/django/utils/translation/trans_null.py
index 3eb6910f04..5cda498336 100644
--- a/django/utils/translation/trans_null.py
+++ b/django/utils/translation/trans_null.py
@@ -4,6 +4,8 @@
from django.conf import settings
+from .trans_real import to_locale as trans_real_to_locale
+
def gettext(message):
return message
@@ -52,12 +54,7 @@ def check_for_language(x):
return True
-def to_locale(language):
- p = language.find('-')
- if p >= 0:
- return language[:p].lower() + '_' + language[p + 1:].upper()
- else:
- return language.lower()
+to_locale = trans_real_to_locale
def get_language_from_request(request, check_path=False):