Code

Opened 6 years ago

Closed 6 years ago

#9924 closed (wontfix)

i18n language selection in sitemaps

Reported by: aronchi Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

To make Google and other spiders crawl our translated web pages it could be possible to add other languages in sitemap.xml

Now it's impossible because language selection is done with accept-language (and google disables it on its spider) and browser cookie (disabled for search engine spiders), and the user can change it via POST to set_language (according to http://docs.djangoproject.com/en/dev/topics/i18n/#the-set-language-redirect-view )

If we enable also GET set_language, it could be possible to add translated pages to sitemap adding to all translated urls an ?language=en

Otherways Google sees only a portion of an i18n web django web site, with a lot of performance loss.

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Enabling GET in set_language will not help you -- set_language is a separate view that has to be visited by the browser. In general there are good reasons for not allowing GET requests to change the user's language.

What you would need is a custom middleware that checks for the ?language=en in the query string and sets the language accordingly. Some projects e.g. multilingual CMS projects use other mechanisms e.g. embed the language code in the URL. Since there are good reasons for the way Django does it at the moment, and Django cannot cater for all the possible ways it could be done, and you can easily roll your own solution, I'm closing WONTFIX.

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.