Code

Opened 6 years ago

Closed 6 years ago

#7450 closed (invalid)

Documentation mistake about use of LANGUAGE_CODE and LANGUAGES

Reported by: Damian Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: docs
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I18n docs say:

If all you want to do is run Django with your native language, and a language file is available for your language, all you need to do is set LANGUAGE_CODE.

This didn't work for me, and I got confused until I understood that several lines later there is a notion that LANGUAGES setting must be added.

I think it will be useful if the docs state the necessity of setting LANGUAGES in the first place.

Attachments (1)

i18n_doc_fix.diff (1.0 KB) - added by Damian 6 years ago.
doc patch

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Damian

doc patch

comment:1 Changed 6 years ago by Simon Greenhill

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 6 years ago by garcia_marc

  • Component changed from Uncategorized to Documentation
  • Summary changed from An i18n doc fix to Documentation mistake about use of LANGUAGE_CODE and LANGUAGES
  • Triage Stage changed from Ready for checkin to Unreviewed

Sorry for reverting the triage stage, but I can't see any problem when following documentation. It works perfectly when setting just LANGUAGE_CODE and not LANGUAGES.

Could you explain exactly why it didn't work for you, and what exactly is the problem, please?

comment:3 Changed 6 years ago by telenieko

  • Resolution set to invalid
  • Status changed from new to closed

The issue is documented a bit below:

Only languages listed in the LANGUAGES setting can be selected. If you want to restrict the language selection to a subset of provided languages (because your application doesn’t provide all those languages), set LANGUAGES to a list of languages. For example:

A bit above there's another important part that explains HOW Django selects the language presented to the user. So, if you set LANGUAGE_CODE to "de" but your visitor (or yourself) send "en" as a requested language Django will answer in English.

So, that is already documented, you just need to read the whole document and interpret it, you'll see that LANGUAGE_CODE is the *last* thing that Django cares about when selecting the language.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.