Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

i18n documentation fixes:

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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@12001 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit adc6113515210c137ae662ef047d86975343eb24 1 parent dd42e4a
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
@@ -231,15 +231,15 @@ Pluralization
231 231
 Use the function ``django.utils.translation.ungettext()`` to specify pluralized
232 232
 messages.
233 233
 
234  
-``ungettext`` takes three arguments: the singular translation string, the plural
235  
-translation string and the number of objects.
  234
+``ungettext`` takes three arguments: the singular translation string, the
  235
+plural translation string and the number of objects.
236 236
 
237  
-This function is useful when your need you Django application to be localizable
  237
+This function is useful when you need your Django application to be localizable
238 238
 to languages where the number and complexity of `plural forms
239 239
 <http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms>`_ is
240 240
 greater than the two forms used in English ('object' for the singular and
241  
-'objects' for all the cases where ``count`` is different from zero, irrespective
242  
-of its value.)
  241
+'objects' for all the cases where ``count`` is different from zero,
  242
+irrespective of its value).
243 243
 
244 244
 For example::
245 245
 
@@ -282,8 +282,8 @@ cardinality of the elements at play.
282 282
 .. note::
283 283
 
284 284
     When using this technique, make sure you use a single name for every
285  
-    extrapolated variable included in the literal. In the example above note how
286  
-    we used the ``name`` Python variable in both translation strings. This
  285
+    extrapolated variable included in the literal. In the example above note
  286
+    how we used the ``name`` Python variable in both translation strings. This
287 287
     example would fail::
288 288
 
289 289
         from django.utils.translation import ungettext
@@ -361,8 +361,8 @@ To pluralize, specify both the singular and plural forms with the
361 361
     {% endblocktrans %}
362 362
 
363 363
 When you use the pluralization feature and bind additional values to local
364  
-variables apart from the counter value that selects the translated literal to be
365  
-used, have in mind that the ``blocktrans`` construct is internally converted
  364
+variables apart from the counter value that selects the translated literal to
  365
+be used, have in mind that the ``blocktrans`` construct is internally converted
366 366
 to an ``ungettext`` call. This means the same :ref:`notes regarding ungettext
367 367
 variables <pluralization-var-notes>` apply.
368 368
 
@@ -381,8 +381,8 @@ Each ``RequestContext`` has access to three translation-specific variables:
381 381
       left-to-right language, e.g.: English, French, German etc.
382 382
 
383 383
 
384  
-If you don't use the ``RequestContext`` extension, you can get those values with
385  
-three tags::
  384
+If you don't use the ``RequestContext`` extension, you can get those values
  385
+with three tags::
386 386
 
387 387
     {% get_current_language as LANGUAGE_CODE %}
388 388
     {% get_available_languages as LANGUAGES %}
@@ -548,8 +548,6 @@ multiple times::
548 548
 When `creating JavaScript translation catalogs`_ you need to use the special
549 549
 'djangojs' domain, **not** ``-e js``.
550 550
 
551  
-.. _create a JavaScript translation catalog: `Creating JavaScript translation catalogs`_
552  
-
553 551
 .. admonition:: No gettext?
554 552
 
555 553
     If you don't have the ``gettext`` utilities installed, ``django-admin.py
@@ -590,8 +588,8 @@ A quick explanation:
590 588
       out empty, so it's your responsibility to change it. Make sure you keep
591 589
       the quotes around your translation.
592 590
     * As a convenience, each message includes, in the form of a comment line
593  
-      prefixed with ``#`` and located above the ``msgid`` line, the filename and
594  
-      line number from which the translation string was gleaned.
  591
+      prefixed with ``#`` and located above the ``msgid`` line, the filename
  592
+      and line number from which the translation string was gleaned.
595 593
 
596 594
 Long messages are a special case. There, the first string directly after the
597 595
 ``msgstr`` (or ``msgid``) is an empty string. Then the content itself will be
@@ -621,9 +619,9 @@ After you create your message file -- and each time you make changes to it --
621 619
 you'll need to compile it into a more efficient form, for use by ``gettext``.
622 620
 Do this with the ``django-admin.py compilemessages`` utility.
623 621
 
624  
-This tool runs over all available ``.po`` files and creates ``.mo`` files, which
625  
-are binary files optimized for use by ``gettext``. In the same directory from
626  
-which you ran ``django-admin.py makemessages``, run ``django-admin.py
  622
+This tool runs over all available ``.po`` files and creates ``.mo`` files,
  623
+which are binary files optimized for use by ``gettext``. In the same directory
  624
+from which you ran ``django-admin.py makemessages``, run ``django-admin.py
627 625
 compilemessages`` like this::
628 626
 
629 627
    django-admin.py compilemessages
@@ -824,9 +822,9 @@ message file. The choice is yours.
824 822
     If you're using manually configured settings, as described
825 823
     :ref:`settings-without-django-settings-module`, the ``locale`` directory in
826 824
     the project directory will not be examined, since Django loses the ability
827  
-    to work out the location of the project directory. (Django normally uses the
828  
-    location of the settings file to determine this, and a settings file doesn't
829  
-    exist if you're manually configuring your settings.)
  825
+    to work out the location of the project directory. (Django normally uses
  826
+    the location of the settings file to determine this, and a settings file
  827
+    doesn't exist if you're manually configuring your settings.)
830 828
 
831 829
 All message file repositories are structured the same way. They are:
832 830
 
@@ -840,12 +838,13 @@ To create message files, you use the same ``django-admin.py makemessages``
840 838
 tool as with the Django message files. You only need to be in the right place
841 839
 -- in the directory where either the ``conf/locale`` (in case of the source
842 840
 tree) or the ``locale/`` (in case of app messages or project messages)
843  
-directory are located. And you use the same ``django-admin.py compilemessages``
844  
-to produce the binary ``django.mo`` files that are used by ``gettext``.
  841
+directory are located. And you use the same ``django-admin.py
  842
+compilemessages`` to produce the binary ``django.mo`` files that are used by
  843
+``gettext``.
845 844
 
846  
-You can also run ``django-admin.py compilemessages --settings=path.to.settings``
847  
-to make the compiler process all the directories in your ``LOCALE_PATHS``
848  
-setting.
  845
+You can also run ``django-admin.py compilemessages
  846
+--settings=path.to.settings`` to make the compiler process all the directories
  847
+in your ``LOCALE_PATHS`` setting.
849 848
 
850 849
 Application message files are a bit complicated to discover -- they need the
851 850
 ``LocaleMiddleware``. If you don't use the middleware, only the Django message
@@ -1020,14 +1019,16 @@ Creating JavaScript translation catalogs
1020 1019
 
1021 1020
 You create and update the translation catalogs the same way as the other
1022 1021
 
1023  
-Django translation catalogs -- with the django-admin.py makemessages tool. The
1024  
-only difference is you need to provide a ``-d djangojs`` parameter, like this::
  1022
+Django translation catalogs -- with the ``django-admin.py makemessages`` tool.
  1023
+The only difference is you need to provide a ``-d djangojs`` parameter, like
  1024
+this::
1025 1025
 
1026 1026
     django-admin.py makemessages -d djangojs -l de
1027 1027
 
1028 1028
 This would create or update the translation catalog for JavaScript for German.
1029  
-After updating translation catalogs, just run ``django-admin.py compilemessages``
1030  
-the same way as you do with normal Django translation catalogs.
  1029
+After updating translation catalogs, just run ``django-admin.py
  1030
+compilemessages`` the same way as you do with normal Django translation
  1031
+catalogs.
1031 1032
 
1032 1033
 Specialties of Django translation
1033 1034
 ==================================
@@ -1048,10 +1049,11 @@ does translation:
1048 1049
 ``gettext`` on Windows
1049 1050
 ======================
1050 1051
 
1051  
-This is only needed for people who either want to extract message IDs or compile
1052  
-message files (``.po``). Translation work itself just involves editing existing
1053  
-files of this type, but if you want to create your own message files, or want to
1054  
-test or compile a changed message file, you will need the ``gettext`` utilities:
  1052
+This is only needed for people who either want to extract message IDs or
  1053
+compile message files (``.po``). Translation work itself just involves editing
  1054
+existing files of this type, but if you want to create your own message files,
  1055
+or want to test or compile a changed message file, you will need the
  1056
+``gettext`` utilities:
1055 1057
 
1056 1058
     * Download the following zip files from the GNOME servers
1057 1059
       http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/ or from one

0 notes on commit adc6113

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