-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Profile language lost when browser is closed #18020
Milestone
Comments
+1, I can reproduce this problem with a very recent dev version (1.16), eg: cc129d2 |
Ah it looks like there are a couple of other places that the below magic needs to be copied in: // Language setting of the user overwrites the one previously set
// If the user does not have a locale set, we save the current one.
if len(u.Language) == 0 {
u.Language = ctx.Locale.Language()
if err := user_model.UpdateUserCols(db.DefaultContext, u, "language"); err != nil {
log.Error(fmt.Sprintf("Error updating user language [user: %d, locale: %s]", u.ID, u.Language))
return setting.AppSubURL + "/"
}
}
middleware.SetLocaleCookie(ctx.Resp, u.Language, 0)
if ctx.Locale.Language() != u.Language {
ctx.Locale = middleware.Locale(ctx.Resp, ctx.Req)
} |
zeripath
added a commit
to zeripath/gitea
that referenced
this issue
Dec 18, 2021
Fix go-gitea#18020 Signed-off-by: Andrew Thornton <[email protected]>
Merged
zeripath
added a commit
that referenced
this issue
Dec 19, 2021
* Reset locale on login Fix #18020 Signed-off-by: Andrew Thornton <[email protected]> * Update routers/web/user/auth.go Co-authored-by: Gusted <[email protected]> Co-authored-by: Gusted <[email protected]>
zeripath
added a commit
to zeripath/gitea
that referenced
this issue
Dec 19, 2021
Backport go-gitea#18023 Although we reset the locale in a number of places there were several ways of logging in that were missing the same code. Fix go-gitea#18020 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Gusted <[email protected]>
zeripath
added a commit
that referenced
this issue
Dec 19, 2021
Backport #18023 Although we reset the locale in a number of places there were several ways of logging in that were missing the same code. Fix #18020 Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: Gusted <[email protected]>
Chianina
pushed a commit
to Chianina/gitea
that referenced
this issue
Mar 28, 2022
* Reset locale on login Fix go-gitea#18020 Signed-off-by: Andrew Thornton <[email protected]> * Update routers/web/user/auth.go Co-authored-by: Gusted <[email protected]> Co-authored-by: Gusted <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Gitea Version
1.15.7
Git Version
2.30.2
Operating System
Debian 11.2
How are you running Gitea?
Using https://dl.gitea.io/gitea/1.15.7/gitea-1.15.7-linux-amd64 running from systemd.
Database
MySQL
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Description
Hello!
I am using Chrome 96 which is sending
accept-language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
.I created an account on try.gitea.io, same thing happens.
The screenshots show the configuration page from my Gitea and try.gitea.io displayed in French but with the language setting showing English.
Screenshots
https://imgur.com/a/EP0mAO2
The text was updated successfully, but these errors were encountered: