Changeset 1209
- Timestamp:
- 11/12/05 18:19:16 (3 years ago)
- Files:
-
- django/trunk/django/utils/translation.py (modified) (2 diffs)
- django/trunk/docs/i18n.txt (modified) (2 diffs)
- django/trunk/docs/settings.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/utils/translation.py
r1208 r1209 257 257 """ 258 258 Checks whether there is a global language file for the given language code. 259 This is used to decide whether a user-provided language is available. this is259 This is used to decide whether a user-provided language is available. This is 260 260 only used for language codes from either the cookies or session. 261 261 """ … … 328 328 def get_date_formats(): 329 329 """ 330 This function checks w ether translation files provide a translation for some330 This function checks whether translation files provide a translation for some 331 331 technical message ID to store date and time formats. If it doesn't contain 332 332 one, the formats provided in the settings will be used. django/trunk/docs/i18n.txt
r1205 r1209 427 427 (Austrian German) but Django only has ``de`` available, Django uses 428 428 ``de``. 429 * only languages listed in the LANGUAGES setting can be selected. So if you want430 to restrict the language selection to a subset of provided languages (because431 your appliaction doesn't provide all those languages), just set it to a list432 of languages like this::429 * Only languages listed in the `LANGUAGES setting`_ can be selected. If 430 you want to restrict the language selection to a subset of provided 431 languages (because your appliaction doesn't provide all those languages), 432 set ``LANGUAGES`` to a list of languages. For example:: 433 433 434 434 LANGUAGES = ( … … 437 437 ) 438 438 439 This would restrict the available languages for automatic selection to German 440 and English (and any sublanguage of those, like de-ch or en-us). 439 This example restricts languages that are available for automatic 440 selection to German and English (and any sublanguage, like de-ch or 441 en-us). 442 443 .. _LANGUAGES setting: http://www.djangoproject.com/documentation/settings/#languages 441 444 442 445 Once ``LocaleMiddleware`` determines the user's preference, it makes this django/trunk/docs/settings.txt
r1206 r1209 404 404 --------- 405 405 406 Default: a list of available languages and their name 407 408 This is a list of two-tuples with language code and language name that are available 409 for language selection. See the `internationalization docs`_ for details. It usually 410 isn't defined, only if you want to restrict language selection to a subset of the 411 django-provided languages you need to set it. 406 Default: A tuple of all available languages. Currently, this is:: 407 408 LANGUAGES = ( 409 ('bn', _('Bengali')), 410 ('cs', _('Czech')), 411 ('cy', _('Welsh')), 412 ('de', _('German')), 413 ('en', _('English')), 414 ('es', _('Spanish')), 415 ('fr', _('French')), 416 ('gl', _('Galician')), 417 ('it', _('Italian')), 418 ('no', _('Norwegian')), 419 ('pt-br', _('Brazilian')), 420 ('ro', _('Romanian')), 421 ('ru', _('Russian')), 422 ('sk', _('Slovak')), 423 ('sr', _('Serbian')), 424 ('zh-cn', _('Simplified Chinese')), 425 ) 426 427 A tuple of two-tuples in the format (language code, language name). This 428 specifies which languages are available for language selection. See the 429 `internationalization docs`_ for details. 430 431 Generally, the default value should suffice. Only set this setting if you want 432 to restrict language selection to a subset of the Django-provided languages. 412 433 413 434 MANAGERS
