django / djangopeople

A geographical community site for Django developers
https://people.djangoproject.com
MIT License
86 stars 44 forks source link

Language switching #78

Open m-aciek opened 8 years ago

m-aciek commented 8 years ago

The question may seem funny, but: Is there a way to switch to another language on the site? https://people.djangoproject.com/es/ links to Django people from Spain, https://es.people.djangoproject.com/ doesn't work. I am afraid translations aren't implemented, can anyone confirm it?

phu commented 7 years ago

The function that Django uses internally to get the language from a request (get_language_from_request) checks the path, the session, the cookies, and the language headers. I was hoping there would be a GET fallback, but there does not appear to be.

Because the site's urls.py hijacks the normal /es/-style language specification, as you mentioned, I don't see how you could change your language as a user, short of clearing your cookies and then having your browser send a different language header. I couldn't find anything in the urls to suggest they've reimplemented this some other way, though it's entirely possible I missed something.

This is a bit confusing, considering there are translations in the code for 17 non-English languages with no easy way to change between them.

m-aciek commented 7 years ago

After having read your comment, I started to investigate. It occurs that LANGUAGES setting was missing 10 languages. I've opened #83. Its merge will solve my concerns. Thanks @phu.

phu commented 7 years ago

Whether this helps really depends on your system language, I think; as I understand it, this should enable those extra languages for users whose browser sends the appropriate headers, but it still won't be possible to manually switch languages (since the normal url patterns for that are overridden by the project).

Am I mistaken, or am I misunderstanding your problem?

m-aciek commented 7 years ago

I was wrongly concerned that site is working only in English, without any option to change the language. That's because I thought my native language was properly added to site, but it wasn't.

So my original motivation to express the need of adding language switching will be gone soon.

phu commented 7 years ago

OK. So your concern isn't actually switching languages, it's that your native language had a translation but hadn't been added to the settings?

m-aciek commented 7 years ago

Yes, it is.

We can keep the issue opened nonetheless. Suggested solution would be letting the user choose a language from a list of available languages in account's settings.