Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Language switching #78

Open
m-aciek opened this issue Oct 27, 2016 · 6 comments
Open

Language switching #78

m-aciek opened this issue Oct 27, 2016 · 6 comments

Comments

@m-aciek
Copy link

m-aciek commented Oct 27, 2016

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
Copy link

phu commented Jun 15, 2017

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
Copy link
Author

m-aciek commented Jun 15, 2017

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
Copy link

phu commented Jun 16, 2017

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
Copy link
Author

m-aciek commented Jun 16, 2017

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
Copy link

phu commented Jun 17, 2017

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
Copy link
Author

m-aciek commented Jun 17, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants