Ticket #7283: i18n.patch
File i18n.patch, 3.2 KB (added by , 16 years ago) |
---|
-
docs/i18n.txt
2 2 Internationalization 3 3 ==================== 4 4 5 Django has full support for internationalization of text in code and templates. 6 Here's how it works.5 The goal of internationalization is to allow a single Web application to offer 6 its content and functionality in multiple languages. 7 7 8 It has 2 aspects, both of which are fully supported by Django:: 9 10 * Internationalization is the process of designing an application 11 so that it can easily adapt to different characters. 12 * Localization is the process of translating text to the language of the 13 user. 14 15 The section below describes the localization aspect. The internationalization 16 aspect is covered in the documentation on `Unicode data in Django`_. 17 18 .. _Unicode data in Django: ../unicode 19 8 20 Overview 9 21 ======== 10 22 11 The goal of internationalization is to allow a single Web application to offer 12 its content and functionality in multiple languages. 13 14 You, the Django developer, can accomplish this goal by adding a minimal amount 15 of hooks to your Python code and templates. These hooks are called 23 You, the Django developer, can accomplish localization by adding a minimal 24 amount of hooks to your Python code and templates. These hooks are called 16 25 **translation strings**. They tell Django: "This text should be translated into 17 26 the end user's language, if a translation for this text is available in that 18 27 language." … … 27 36 * It uses these hooks to translate Web apps for particular users according 28 37 to their language preferences. 29 38 30 If you don't need internationalization in your app31 ========================================== ========39 If you don't need localization in your app 40 ========================================== 32 41 33 Django's internationalization hooks are on by default, and that means there's a42 Django's localization hooks are on by default, and that means there's a 34 43 bit of i18n-related overhead in certain places of the framework. If you don't 35 use internationalization, you should take the two seconds to set36 ``USE_I18N = False`` in your settings file. If ``USE_I18N`` is set to 37 ``False``, then Django will make some optimizations so as not to load the 38 internationalization machinery.See the `documentation for USE_I18N`_.44 use localization, you should take the two seconds to set ``USE_I18N = False`` 45 in your settings file. If ``USE_I18N`` is set to ``False``, then Django will 46 make some optimizations so as not to load the localization machinery. 47 See the `documentation for USE_I18N`_. 39 48 40 49 You'll probably also want to remove ``'django.core.context_processors.i18n'`` 41 50 from your ``TEMPLATE_CONTEXT_PROCESSORS`` setting. 42 51 43 52 .. _documentation for USE_I18N: ../settings/#use-i18n 44 53 45 If you do need internationalization: three steps46 ======================================== ========54 If you do need localization: three steps 55 ======================================== 47 56 48 57 1. Embed translation strings in your Python code and templates. 49 58 2. Get translations for those strings, in whichever languages you want to