diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-09-29 16:13:10 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-10-01 14:57:16 +0200 |
| commit | fa2f55cfd554c6f99653ffe0d40fd7ca74cb680e (patch) | |
| tree | 9fcc03004ae628a176dca0a98accc9ead4910021 /django/utils | |
| parent | 63bf615d5e5566e23ba698f95e64acfa9f2651ff (diff) | |
Refs #26940 -- Re-allowed makemessages without settings
Thanks Tim Graham for the review.
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/translation/__init__.py | 4 | ||||
| -rw-r--r-- | django/utils/translation/template.py | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/django/utils/translation/__init__.py b/django/utils/translation/__init__.py index a5975b005c..39d0f4162b 100644 --- a/django/utils/translation/__init__.py +++ b/django/utils/translation/__init__.py @@ -212,9 +212,9 @@ def get_language_from_path(path): return _trans.get_language_from_path(path) -def templatize(src, origin=None): +def templatize(src, **kwargs): from .template import templatize - return templatize(src, origin) + return templatize(src, **kwargs) def deactivate_all(): diff --git a/django/utils/translation/template.py b/django/utils/translation/template.py index fd7c065256..b8618c4dd2 100644 --- a/django/utils/translation/template.py +++ b/django/utils/translation/template.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import re import warnings -from django.conf import settings from django.template.base import ( TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_TEXT, TOKEN_VAR, TRANSLATOR_COMMENT_MARK, Lexer, @@ -40,13 +39,13 @@ plural_re = re.compile(r"""^\s*plural$""") constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""") -def templatize(src, origin=None): +def templatize(src, origin=None, charset='utf-8'): """ Turn a Django template into something that is understood by xgettext. It does so by translating the Django translation tags into standard gettext function invocations. """ - src = force_text(src, settings.FILE_CHARSET) + src = force_text(src, charset) out = StringIO('') message_context = None intrans = False |
