From 1406265e17d9e64cbe82951223689d07af43fc42 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Mon, 7 Feb 2011 19:50:07 +0000 Subject: [PATCH] [1.2.X] Tweaked language markers in i18n topic document for better Sphinx syntax highlighting. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15442 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/topics/i18n/internationalization.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/topics/i18n/internationalization.txt b/docs/topics/i18n/internationalization.txt index 771a36b3e0..4804a75266 100644 --- a/docs/topics/i18n/internationalization.txt +++ b/docs/topics/i18n/internationalization.txt @@ -291,8 +291,6 @@ translation method! Working with lazy translation objects ------------------------------------- -.. highlightlang:: python - Using ``ugettext_lazy()`` and ``ungettext_lazy()`` to mark strings in models and utility functions is a common operation. When you're working with these objects elsewhere in your code, you should ensure that you don't accidentally @@ -507,6 +505,8 @@ string, so they don't need to be aware of translations. Specifying translation strings: In JavaScript code ================================================== +.. highlightlang:: python + Adding translations to JavaScript poses some problems: * JavaScript code doesn't have access to a ``gettext`` implementation. @@ -568,7 +568,11 @@ catalog file. As a security measure, these values can only be either Using the JavaScript translation catalog ---------------------------------------- -To use the catalog, just pull in the dynamically generated script like this:: +.. highlightlang:: javascript + +To use the catalog, just pull in the dynamically generated script like this: + +.. code-block:: html+django @@ -623,6 +627,8 @@ to produce proper pluralizations). The ``set_language`` redirect view ================================== +.. highlightlang:: python + .. function:: set_language(request) As a convenience, Django comes with a view, :meth:`django.views.i18n.set_language`,