Django

Code

Show
Ignore:
Timestamp:
06/17/07 17:18:54 (2 years ago)
Author:
clong
Message:

per-object-permissions: Merged to trunk [5486] NOTE: Not fully tested, will be working on this over the next few weeks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/per-object-permissions/docs/i18n.txt

    r3630 r5488  
    5454from your ``TEMPLATE_CONTEXT_PROCESSORS`` setting. 
    5555 
    56 .. _documentation for USE_I18N: http://www.djangoproject.com/documentation/settings/#use-i18n 
     56.. _documentation for USE_I18N: ../settings/#use-i18n 
    5757 
    5858How to specify translation strings 
     
    176176            verbose_name_plural = _('mythings') 
    177177 
    178 .. _Django models: http://www.djangoproject.com/documentation/model_api/ 
     178.. _Django models: ../model-api/ 
    179179 
    180180Pluralization 
     
    237237``{% endblocktrans %}``. Example:: 
    238238 
    239     {% blocktrans count list|count as counter %} 
     239    {% blocktrans count list|length as counter %} 
    240240    There is only one {{ name }} object. 
    241241    {% plural %} 
     
    275275string, so they don't need to be aware of translations. 
    276276 
    277 .. _Django templates: http://www.djangoproject.com/documentation/templates_python/ 
     277.. _Django templates: ../templates_python/ 
    278278 
    279279How to create language files 
     
    282282Once you've tagged your strings for later translation, you need to write (or 
    283283obtain) the language translations themselves. Here's how that works. 
     284 
     285.. admonition:: Locale restrictions 
     286 
     287    Django does not support localizing your application into a locale for 
     288    which Django itself has not been translated. In this case, it will ignore 
     289    your translation files. If you were to try this and Django supported it, 
     290    you would inevitably see a mixture of translated strings (from your 
     291    application) and English strings (from Django itself). If you want to 
     292    support a locale for your application that is not already part of 
     293    Django, you'll need to make at least a minimal translation of the Django 
     294    core. 
    284295 
    285296Message files 
     
    300311...where ``de`` is the language code for the message file you want to create. 
    301312The language code, in this case, is in locale format. For example, it's 
    302 ``pt_BR`` for Brazilian and ``de_AT`` for Austrian German. 
     313``pt_BR`` for Brazilian Portugese and ``de_AT`` for Austrian German. 
    303314 
    304315The script should be run from one of three places: 
     
    395406    the steps to take. 
    396407 
    397     .. _Submitting and maintaining translations: http://www.djangoproject.com/documentation/contributing/ 
     408    .. _Submitting and maintaining translations: ../contributing/ 
    398409 
    399410How Django discovers language preference 
     
    453464 
    454465    * In each of these places, the language preference is expected to be in the 
    455       standard language format, as a string. For example, Brazilian is 
    456       ``pt-br``. 
     466      standard language format, as a string. For example, Brazilian Portugese 
     467      is ``pt-br``. 
    457468    * If a base language is available but the sublanguage specified is not, 
    458469      Django uses the base language. For example, if a user specifies ``de-at`` 
     
    473484      en-us). 
    474485 
    475       .. _LANGUAGES setting: http://www.djangoproject.com/documentation/settings/#languages 
     486      .. _LANGUAGES setting: ../settings/#languages 
    476487 
    477488    * If you define a custom ``LANGUAGES`` setting, as explained in the 
     
    531542in ``request.LANGUAGE_CODE``. 
    532543 
    533 .. _settings file: http://www.djangoproject.com/documentation/settings/ 
    534 .. _middleware documentation: http://www.djangoproject.com/documentation/middleware/ 
    535 .. _session: http://www.djangoproject.com/documentation/sessions/ 
    536 .. _request object: http://www.djangoproject.com/documentation/request_response/#httprequest-objects 
     544.. _settings file: ../settings/ 
     545.. _middleware documentation: ../middleware/ 
     546.. _session: ../sessions/ 
     547.. _request object: ../request_response/#httprequest-objects 
    537548 
    538549The ``set_language`` redirect view 
     
    600611    if you're manually configuring your settings.) 
    601612 
    602 .. _settings documentation: http://www.djangoproject.com/documentation/settings/#using-settings-without-the-django-settings-module-environment-variable 
     613.. _settings documentation: ../settings/#using-settings-without-the-django-settings-module-environment-variable 
    603614 
    604615All message file repositories are structured the same way. They are: