summaryrefslogtreecommitdiff
path: root/django/utils/translation/trans_real.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-12-08 11:13:52 +0100
committerClaude Paroz <claude@2xlibre.net>2012-12-08 11:13:52 +0100
commitc91667338a4e774e2819ccf4da852dc7b759bc19 (patch)
tree42a700d237c85ac2b647999d02d3dcd7d8047068 /django/utils/translation/trans_real.py
parent53b879f045f0e55cc8f4bedff67b5a14f3057561 (diff)
Fixed #19357 -- Allow non-ASCII chars in filesystem paths
Thanks kujiu for the report and Aymeric Augustin for the review.
Diffstat (limited to 'django/utils/translation/trans_real.py')
-rw-r--r--django/utils/translation/trans_real.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 1bcef2d8de..cf6270cc0c 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -10,6 +10,7 @@ from threading import local
from django.utils.importlib import import_module
from django.utils.encoding import force_str, force_text
+from django.utils._os import upath
from django.utils.safestring import mark_safe, SafeData
from django.utils import six
from django.utils.six import StringIO
@@ -109,7 +110,7 @@ def translation(language):
from django.conf import settings
- globalpath = os.path.join(os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
+ globalpath = os.path.join(os.path.dirname(upath(sys.modules[settings.__module__].__file__)), 'locale')
def _fetch(lang, fallback=None):
@@ -151,7 +152,7 @@ def translation(language):
for appname in reversed(settings.INSTALLED_APPS):
app = import_module(appname)
- apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
+ apppath = os.path.join(os.path.dirname(upath(app.__file__)), 'locale')
if os.path.isdir(apppath):
res = _merge(apppath)
@@ -337,7 +338,7 @@ def all_locale_paths():
"""
from django.conf import settings
globalpath = os.path.join(
- os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
+ os.path.dirname(upath(sys.modules[settings.__module__].__file__)), 'locale')
return [globalpath] + list(settings.LOCALE_PATHS)
def check_for_language(lang_code):