From f913e4d8c94a69794527a7c2b556a4dfd9e831d9 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Fri, 30 Sep 2005 08:49:11 +0000 Subject: [PATCH] added a gettext_noop function to django.utils.translation git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@738 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/translation.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/django/utils/translation.py b/django/utils/translation.py index 293c7ed261..6385c7b26b 100644 --- a/django/utils/translation.py +++ b/django/utils/translation.py @@ -139,6 +139,16 @@ def gettext(message): _default = translation('*', settings.LANGUAGE_CODE) return _default.gettext(message) +def gettext_noop(message): + """ + This function is used to just mark strings for translation + but to not translate them now. This can be used to store + strings in global variables that should stay in the base + language (because they might be used externally) and will + be translated later on. + """ + return message + def get_language_from_request(request): """ analyze the request to find what language the user