Changeset 5488 for django/branches/per-object-permissions/docs/i18n.txt
- Timestamp:
- 06/17/07 17:18:54 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/per-object-permissions/docs/i18n.txt
r3630 r5488 54 54 from your ``TEMPLATE_CONTEXT_PROCESSORS`` setting. 55 55 56 .. _documentation for USE_I18N: http://www.djangoproject.com/documentation/settings/#use-i18n56 .. _documentation for USE_I18N: ../settings/#use-i18n 57 57 58 58 How to specify translation strings … … 176 176 verbose_name_plural = _('mythings') 177 177 178 .. _Django models: http://www.djangoproject.com/documentation/model_api/178 .. _Django models: ../model-api/ 179 179 180 180 Pluralization … … 237 237 ``{% endblocktrans %}``. Example:: 238 238 239 {% blocktrans count list| countas counter %}239 {% blocktrans count list|length as counter %} 240 240 There is only one {{ name }} object. 241 241 {% plural %} … … 275 275 string, so they don't need to be aware of translations. 276 276 277 .. _Django templates: http://www.djangoproject.com/documentation/templates_python/277 .. _Django templates: ../templates_python/ 278 278 279 279 How to create language files … … 282 282 Once you've tagged your strings for later translation, you need to write (or 283 283 obtain) 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. 284 295 285 296 Message files … … 300 311 ...where ``de`` is the language code for the message file you want to create. 301 312 The 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. 303 314 304 315 The script should be run from one of three places: … … 395 406 the steps to take. 396 407 397 .. _Submitting and maintaining translations: http://www.djangoproject.com/documentation/contributing/408 .. _Submitting and maintaining translations: ../contributing/ 398 409 399 410 How Django discovers language preference … … 453 464 454 465 * In each of these places, the language preference is expected to be in the 455 standard language format, as a string. For example, Brazilian is456 ``pt-br``.466 standard language format, as a string. For example, Brazilian Portugese 467 is ``pt-br``. 457 468 * If a base language is available but the sublanguage specified is not, 458 469 Django uses the base language. For example, if a user specifies ``de-at`` … … 473 484 en-us). 474 485 475 .. _LANGUAGES setting: http://www.djangoproject.com/documentation/settings/#languages486 .. _LANGUAGES setting: ../settings/#languages 476 487 477 488 * If you define a custom ``LANGUAGES`` setting, as explained in the … … 531 542 in ``request.LANGUAGE_CODE``. 532 543 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-objects544 .. _settings file: ../settings/ 545 .. _middleware documentation: ../middleware/ 546 .. _session: ../sessions/ 547 .. _request object: ../request_response/#httprequest-objects 537 548 538 549 The ``set_language`` redirect view … … 600 611 if you're manually configuring your settings.) 601 612 602 .. _settings documentation: http://www.djangoproject.com/documentation/settings/#using-settings-without-the-django-settings-module-environment-variable613 .. _settings documentation: ../settings/#using-settings-without-the-django-settings-module-environment-variable 603 614 604 615 All message file repositories are structured the same way. They are:
