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

Default language for all new users #3927

Closed
devagleo opened this issue Jul 28, 2021 · 6 comments
Closed

Default language for all new users #3927

devagleo opened this issue Jul 28, 2021 · 6 comments

Comments

@devagleo
Copy link

Can I set the default language for all users when they sign in and when working with boards?
I read in previous issues that the language is stored in cookies, but maybe it can be set globally when starting the server in the configuration?

@xet7
Copy link
Member

xet7 commented Jul 28, 2021

@devagleo

There is not that feature yet. Languages are listed here. Maybe you could use shell script? For example, for Snap, changing to language de, those 2 places in database query:

lang.sh

#!/bin/bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/snap/wekan/current/lib/x86_64-linux-gnu
export PATH="$PATH:/snap/wekan/current/bin"
mongo --port 27019 < lang.js

lang.js , this sets language for those that don't yet have that language.

use wekan
db.users.update({"profile.language":{$ne:"de"}},{$set:{"profile.language":"de"}},{multi:true})

Also set script as executeable:

chmod +x lang.sh

And then run it with:

./lang.sh

@xet7
Copy link
Member

xet7 commented Jul 28, 2021

For Windows, it's like this:

lang.bat

mongo --port 27017 < lang.js

lang.js

use wekan
db.users.update({"profile.language":{$ne:"de"}},{$set:{"profile.language":"de"}},{multi:true})

@devagleo
Copy link
Author

For Windows, it's like this:

lang.bat

mongo --port 27017 < lang.js

lang.js

use wekan
db.users.update({"profile.language":{$ne:"de"}},{$set:{"profile.language":"de"}},{multi:true})

I used it, the welcome page really seems to have changed to the desired language, but for new users the language after authorization remained English.
My understanding is that db.users.update updates the language to all existing users, but not new ones. Is there some solution possible?

@xet7
Copy link
Member

xet7 commented Aug 1, 2021

@devagleo

Well, maybe createUser at https://github.com/wekan/wekan/blob/master/models/users.js should read some new language setting like LANG similar like this, for example process.env.LANG and set it to public variable, and save it to profile when creating user, and from that public variable read it somewhere near here:

./client/components/main/layouts.js:      } else if (lang.name === 'en-IT') {
./client/components/users/userHeader.js:      } else if (lang.name === 'en-IT') {

Then, at Admin Panel could be something similar to Hide System Messages to set language for all users.

So, maybe someone could figure it out and send pull request, with info provided above. (Or maybe me, if nobody volunteers).

@helioguardabaxo What do you think?

@xet7
Copy link
Member

xet7 commented Aug 1, 2021

@devagleo
Copy link
Author

devagleo commented May 6, 2022

I would like to continue the conversation.

./client/components/main/layouts.js: } else if (lang.name === 'en-IT') {
./client/components/users/userHeader.js: } else if (lang.name === 'en-IT') {

For new users, the language is perfectly chosen.

But for people who are not registered and open public boards by link, they still get the wrong language.
For them, I would like to change the view of the board view from Swimlanes to Lists

@xet7 xet7 closed this as completed Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants