Opened 14 years ago

Closed 14 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: no UI/UX: no


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 )

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.

Change History (1)

comment:1 Changed 14 years ago by Luke Plant

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top