Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Ability to change language on-the-fly #1393

Open
pyhedgehog opened this issue Sep 28, 2022 · 1 comment
Open

FR: Ability to change language on-the-fly #1393

pyhedgehog opened this issue Sep 28, 2022 · 1 comment

Comments

@pyhedgehog
Copy link
Contributor

pyhedgehog commented Sep 28, 2022

Right now language of site can only be configured by:

  1. User settings (if user had logged-in).
  2. Browser language settings (if user is anonymous).
    In some cases (for public sites and for localizer debug comfort) there should be ability to temporary switch language.

I think there should be either query-string parameter:

http://localhost:3000/page/SomePage?lang=ru
http://localhost:3000/page/SomePage?lang=cn

Another implementation can be cookie that can be set by GET request:

http://localhost:3000/auth/setlanguage?lang=ru&redirect=/page/SomePage
http://localhost:3000/auth/setlanguage?lang=cn&redirect=/page/SomePage

Both cases can be used to create menu entries to switch language (that;s why I insist on GET parameters).

Let's pretend those:

  1. who prefer query-string for every page (and mechanics to pass it to every link) vote with
  2. who prefer GET-request to /auth/setlanguage (without _csrf parameter) vote with
@pyhedgehog
Copy link
Contributor Author

Found that there are already exists entrypoint /auth/setlanguage. But it can't be used in menu, due to it's POST request and requires _csrf parameter.
So I've changed request to use this entrypoint instead of /auth/switchlang, and propose voting for users.

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

No branches or pull requests

1 participant