diff --git a/django/contrib/gis/templates/gis/google/google-map.js b/django/contrib/gis/templates/gis/google/google-map.js
index 06f11e3..9eac3a4 100644
--- a/django/contrib/gis/templates/gis/google/google-map.js
+++ b/django/contrib/gis/templates/gis/google/google-map.js
@@ -1,4 +1,5 @@
 {% autoescape off %}
+{% noloc %}
 {% block vars %}var geodjango = {};{% for icon in icons %} 
 var {{ icon.varname }} = new GIcon(G_DEFAULT_ICON); 
 {% if icon.image %}{{ icon.varname }}.image = "{{ icon.image }}";{% endif %}
@@ -32,4 +33,4 @@ var {{ icon.varname }} = new GIcon(G_DEFAULT_ICON);
     alert("Sorry, the Google Maps API is not compatible with this browser.");
   }
 }
-{% endblock load %}{% endblock functions %}{% endautoescape %}
+{% endblock load %}{% endblock functions %}{% endnoloc %}{% endautoescape %}
diff --git a/django/template/__init__.py b/django/template/__init__.py
index c316786..d51c773 100644
--- a/django/template/__init__.py
+++ b/django/template/__init__.py
@@ -825,7 +825,8 @@ def _render_value_in_context(value, context):
     means escaping, if required, and conversion to a unicode object. If value
     is a string, it is expected to have already been translated.
     """
-    value = localize(value)
+    if '_no_l10n' not in context:
+        value = localize(value)
     value = force_unicode(value)
     if (context.autoescape and not isinstance(value, SafeData)) or isinstance(value, EscapeData):
         return escape(value)
diff --git a/django/template/debug.py b/django/template/debug.py
index c21fb50..2f5715d 100644
--- a/django/template/debug.py
+++ b/django/template/debug.py
@@ -87,7 +87,8 @@ class DebugVariableNode(VariableNode):
     def render(self, context):
         try:
             output = self.filter_expression.resolve(context)
-            output = localize(output)
+            if '_no_l10n' not in context:
+                output = localize(output)
             output = force_unicode(output)
         except TemplateSyntaxError, e:
             if not hasattr(e, 'source'):
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index 1b07413..4be54f5 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -433,6 +433,19 @@ class WithNode(Node):
         context.pop()
         return output
 
+class NoLocalizationNode(Node):
+    def __init__(self, nodelist):
+        self.nodelist = nodelist
+
+    def __repr__(self):
+        return "<NoLocalizationNode>"
+
+    def render(self, context):
+        context['_no_l10n'] = True
+        output = self.nodelist.render(context)
+        del context['_no_l10n']
+        return output
+
 #@register.tag
 def autoescape(parser, token):
     """
@@ -1216,3 +1229,16 @@ def do_with(parser, token):
     parser.delete_first_token()
     return WithNode(var, name, nodelist)
 do_with = register.tag('with', do_with)
+
+@register.tag('noloc')
+def do_noloc(parser, token):
+    """
+    Temporarely deactivates localization inside of this block, e.g.
+    to avoid rendering syntactically incorrect JavaScript code.
+    """
+    bits = list(token.split_contents())
+    if len(bits) != 1:
+        raise TemplateSyntaxError("%r doesn't take any arguments" % bits[0])
+    nodelist = parser.parse(('endnoloc',))
+    parser.delete_first_token()
+    return NoLocalizationNode(nodelist)
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 70f0ffd..077caec 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -639,6 +639,32 @@ Load a custom template tag set.
 
 See :doc:`Custom tag and filter libraries </howto/custom-template-tags>` for more information.
 
+.. templatetag:: noloc
+
+noloc
+~~~~~
+
+.. versionadded:: 1.3
+
+Deactivates localization of variables in the contained block.
+
+While localization of variables is generally useful, sometimes it has undesirable
+effects, e.g. when you render JavaScript code through the template system. Consider this
+template code::
+
+    var pi = {{ 3.1415 }};
+
+If localization is enabled, the output from this template is not syntetically correct
+JavaScript in some locales (e.g. German)::
+
+    var pi = 3,1415;
+
+To avoid this issue, wrap the affected template code in a ``{% noloc %}`` tag::
+
+    {% noloc %}
+        var pi = {{ 3.1415 }};
+    {% endnoloc %}
+
 .. templatetag:: now
 
 now
diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py
index 4aa52b6..f5bcdee 100644
--- a/tests/regressiontests/i18n/tests.py
+++ b/tests/regressiontests/i18n/tests.py
@@ -453,6 +453,23 @@ class FormattingTests(TestCase):
             settings.FORMAT_MODULE_PATH = old_format_module_path
             deactivate()
 
+    def test_noloc_templatetag(self):
+        """
+        Tests the {% noloc %} templatetag
+        """
+        activate('de-de')
+        context = Context({'the_var': 3.14 })
+        template = Template("{{ the_var }};{% noloc %}{{ the_var }};{% endnoloc %}{{ the_var }}")
+        old_debug = settings.TEMPLATE_DEBUG
+        try:
+            for debug in (True, False):
+                settings.TEMPLATE_DEBUG = debug
+                settings.USE_L10N = True
+                self.assertEqual(template.render(context), '3,14;3.14;3,14')
+        finally:
+            deactivate()
+            settings.TEMPLATE_DEBUG = old_debug
+
 class MiscTests(TestCase):
 
     def test_parse_spec_http_header(self):
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 6683ebb..0e060c3 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -375,7 +375,8 @@ class Templates(unittest.TestCase):
                 activate(vals[1]['LANGUAGE_CODE'])
             else:
                 activate('en-us')
-
+            old_l10n = settings.USE_L10N
+            settings.USE_L10N = vals[1].get('USE_L10N', old_l10n)
             for invalid_str, result in [('', normal_string_result),
                                         (expected_invalid_str, invalid_string_result)]:
                 settings.TEMPLATE_STRING_IF_INVALID = invalid_str
@@ -408,6 +409,8 @@ class Templates(unittest.TestCase):
             if 'LANGUAGE_CODE' in vals[1]:
                 deactivate()
 
+            settings.USE_L10N = old_l10n
+
             if template.invalid_var_format_string:
                 expected_invalid_str = 'INVALID'
                 template.invalid_var_format_string = False
@@ -1122,6 +1125,10 @@ class Templates(unittest.TestCase):
             # translation of singular form in russian (#14126)
             'i18n27': ('{% load i18n %}{% blocktrans count number as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %}', {'number': 1, 'LANGUAGE_CODE': 'ru'}, u'1 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442'),
 
+            ### L10N ###
+  
+            # test the {% noloc %} tag
+            'l10n01': ('{{ the_var }};{% noloc %}{{ the_var }};{% endnoloc %}{{ the_var }}', {'the_var': 3.14, 'LANGUAGE_CODE': 'de-de', 'USE_L10N': True}, u'3,14;3.14;3,14'),
             ### HANDLING OF TEMPLATE_STRING_IF_INVALID ###################################
 
             'invalidstr01': ('{{ var|default:"Foo" }}', {}, ('Foo','INVALID')),
