Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.1.X] i18n documentation fixes:

 * Fixed typo (fixes #12449, thanks googol).
 * Wrapped long lines.
 * Removed unused link target directive.

Backport of r12001 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12002 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3201e7b0b19905ccf524211234421dd50dbf469a 1 parent 4c5429d
Gary Wilson Jr. authored December 26, 2009

Showing 1 changed file with 36 additions and 34 deletions. Show diff stats Hide diff stats

  1. 70  docs/topics/i18n.txt
70  docs/topics/i18n.txt
@@ -225,15 +225,15 @@ Pluralization
225 225
 Use the function ``django.utils.translation.ungettext()`` to specify pluralized
226 226
 messages.
227 227
 
228  
-``ungettext`` takes three arguments: the singular translation string, the plural
229  
-translation string and the number of objects.
  228
+``ungettext`` takes three arguments: the singular translation string, the
  229
+plural translation string and the number of objects.
230 230
 
231  
-This function is useful when your need you Django application to be localizable
  231
+This function is useful when you need your Django application to be localizable
232 232
 to languages where the number and complexity of `plural forms
233 233
 <http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms>`_ is
234 234
 greater than the two forms used in English ('object' for the singular and
235  
-'objects' for all the cases where ``count`` is different from zero, irrespective
236  
-of its value.)
  235
+'objects' for all the cases where ``count`` is different from zero,
  236
+irrespective of its value).
237 237
 
238 238
 For example::
239 239
 
@@ -276,8 +276,8 @@ cardinality of the elements at play.
276 276
 .. note::
277 277
 
278 278
     When using this technique, make sure you use a single name for every
279  
-    extrapolated variable included in the literal. In the example above note how
280  
-    we used the ``name`` Python variable in both translation strings. This
  279
+    extrapolated variable included in the literal. In the example above note
  280
+    how we used the ``name`` Python variable in both translation strings. This
281 281
     example would fail::
282 282
 
283 283
         from django.utils.translation import ungettext
@@ -355,8 +355,8 @@ To pluralize, specify both the singular and plural forms with the
355 355
     {% endblocktrans %}
356 356
 
357 357
 When you use the pluralization feature and bind additional values to local
358  
-variables apart from the counter value that selects the translated literal to be
359  
-used, have in mind that the ``blocktrans`` construct is internally converted
  358
+variables apart from the counter value that selects the translated literal to
  359
+be used, have in mind that the ``blocktrans`` construct is internally converted
360 360
 to an ``ungettext`` call. This means the same :ref:`notes regarding ungettext
361 361
 variables <pluralization-var-notes>` apply.
362 362
 
@@ -375,8 +375,8 @@ Each ``RequestContext`` has access to three translation-specific variables:
375 375
       left-to-right language, e.g.: English, French, German etc.
376 376
 
377 377
 
378  
-If you don't use the ``RequestContext`` extension, you can get those values with
379  
-three tags::
  378
+If you don't use the ``RequestContext`` extension, you can get those values
  379
+with three tags::
380 380
 
381 381
     {% get_current_language as LANGUAGE_CODE %}
382 382
     {% get_available_languages as LANGUAGES %}
@@ -542,8 +542,6 @@ multiple times::
542 542
 When `creating JavaScript translation catalogs`_ you need to use the special
543 543
 'djangojs' domain, **not** ``-e js``.
544 544
 
545  
-.. _create a JavaScript translation catalog: `Creating JavaScript translation catalogs`_
546  
-
547 545
 .. admonition:: No gettext?
548 546
 
549 547
     If you don't have the ``gettext`` utilities installed, ``django-admin.py
@@ -584,8 +582,8 @@ A quick explanation:
584 582
       out empty, so it's your responsibility to change it. Make sure you keep
585 583
       the quotes around your translation.
586 584
     * As a convenience, each message includes, in the form of a comment line
587  
-      prefixed with ``#`` and located above the ``msgid`` line, the filename and
588  
-      line number from which the translation string was gleaned.
  585
+      prefixed with ``#`` and located above the ``msgid`` line, the filename
  586
+      and line number from which the translation string was gleaned.
589 587
 
590 588
 Long messages are a special case. There, the first string directly after the
591 589
 ``msgstr`` (or ``msgid``) is an empty string. Then the content itself will be
@@ -615,9 +613,9 @@ After you create your message file -- and each time you make changes to it --
615 613
 you'll need to compile it into a more efficient form, for use by ``gettext``.
616 614
 Do this with the ``django-admin.py compilemessages`` utility.
617 615
 
618  
-This tool runs over all available ``.po`` files and creates ``.mo`` files, which
619  
-are binary files optimized for use by ``gettext``. In the same directory from
620  
-which you ran ``django-admin.py makemessages``, run ``django-admin.py
  616
+This tool runs over all available ``.po`` files and creates ``.mo`` files,
  617
+which are binary files optimized for use by ``gettext``. In the same directory
  618
+from which you ran ``django-admin.py makemessages``, run ``django-admin.py
621 619
 compilemessages`` like this::
622 620
 
623 621
    django-admin.py compilemessages
@@ -818,9 +816,9 @@ message file. The choice is yours.
818 816
     If you're using manually configured settings, as described
819 817
     :ref:`settings-without-django-settings-module`, the ``locale`` directory in
820 818
     the project directory will not be examined, since Django loses the ability
821  
-    to work out the location of the project directory. (Django normally uses the
822  
-    location of the settings file to determine this, and a settings file doesn't
823  
-    exist if you're manually configuring your settings.)
  819
+    to work out the location of the project directory. (Django normally uses
  820
+    the location of the settings file to determine this, and a settings file
  821
+    doesn't exist if you're manually configuring your settings.)
824 822
 
825 823
 All message file repositories are structured the same way. They are:
826 824
 
@@ -834,12 +832,13 @@ To create message files, you use the same ``django-admin.py makemessages``
834 832
 tool as with the Django message files. You only need to be in the right place
835 833
 -- in the directory where either the ``conf/locale`` (in case of the source
836 834
 tree) or the ``locale/`` (in case of app messages or project messages)
837  
-directory are located. And you use the same ``django-admin.py compilemessages``
838  
-to produce the binary ``django.mo`` files that are used by ``gettext``.
  835
+directory are located. And you use the same ``django-admin.py
  836
+compilemessages`` to produce the binary ``django.mo`` files that are used by
  837
+``gettext``.
839 838
 
840  
-You can also run ``django-admin.py compilemessages --settings=path.to.settings``
841  
-to make the compiler process all the directories in your ``LOCALE_PATHS``
842  
-setting.
  839
+You can also run ``django-admin.py compilemessages
  840
+--settings=path.to.settings`` to make the compiler process all the directories
  841
+in your ``LOCALE_PATHS`` setting.
843 842
 
844 843
 Application message files are a bit complicated to discover -- they need the
845 844
 ``LocaleMiddleware``. If you don't use the middleware, only the Django message
@@ -1014,14 +1013,16 @@ Creating JavaScript translation catalogs
1014 1013
 
1015 1014
 You create and update the translation catalogs the same way as the other
1016 1015
 
1017  
-Django translation catalogs -- with the django-admin.py makemessages tool. The
1018  
-only difference is you need to provide a ``-d djangojs`` parameter, like this::
  1016
+Django translation catalogs -- with the ``django-admin.py makemessages`` tool.
  1017
+The only difference is you need to provide a ``-d djangojs`` parameter, like
  1018
+this::
1019 1019
 
1020 1020
     django-admin.py makemessages -d djangojs -l de
1021 1021
 
1022 1022
 This would create or update the translation catalog for JavaScript for German.
1023  
-After updating translation catalogs, just run ``django-admin.py compilemessages``
1024  
-the same way as you do with normal Django translation catalogs.
  1023
+After updating translation catalogs, just run ``django-admin.py
  1024
+compilemessages`` the same way as you do with normal Django translation
  1025
+catalogs.
1025 1026
 
1026 1027
 Specialties of Django translation
1027 1028
 ==================================
@@ -1042,10 +1043,11 @@ does translation:
1042 1043
 ``gettext`` on Windows
1043 1044
 ======================
1044 1045
 
1045  
-This is only needed for people who either want to extract message IDs or compile
1046  
-message files (``.po``). Translation work itself just involves editing existing
1047  
-files of this type, but if you want to create your own message files, or want to
1048  
-test or compile a changed message file, you will need the ``gettext`` utilities:
  1046
+This is only needed for people who either want to extract message IDs or
  1047
+compile message files (``.po``). Translation work itself just involves editing
  1048
+existing files of this type, but if you want to create your own message files,
  1049
+or want to test or compile a changed message file, you will need the
  1050
+``gettext`` utilities:
1049 1051
 
1050 1052
     * Download the following zip files from the GNOME servers
1051 1053
       http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/ or from one

0 notes on commit 3201e7b

Please sign in to comment.
Something went wrong with that request. Please try again.