From 6b8ca26f4eaa5ec515f2d3d2bf7fb22fbc4ef7f3 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 25 Sep 2021 20:25:58 +0800 Subject: [PATCH 1/2] Fix wrong i18n keys --- routers/web/user/setting/security_twofa.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/web/user/setting/security_twofa.go b/routers/web/user/setting/security_twofa.go index 7b08a05939b30..4d9c41489ca8e 100644 --- a/routers/web/user/setting/security_twofa.go +++ b/routers/web/user/setting/security_twofa.go @@ -150,7 +150,7 @@ func EnrollTwoFactor(ctx *context.Context) { if t != nil { // already enrolled - we should redirect back! log.Warn("Trying to re-enroll %-v in twofa when already enrolled", ctx.User) - ctx.Flash.Error(ctx.Tr("setting.twofa_is_enrolled")) + ctx.Flash.Error(ctx.Tr("settings.twofa_is_enrolled")) ctx.Redirect(setting.AppSubURL + "/user/settings/security") return } @@ -175,7 +175,7 @@ func EnrollTwoFactorPost(ctx *context.Context) { t, err := models.GetTwoFactorByUID(ctx.User.ID) if t != nil { // already enrolled - ctx.Flash.Error(ctx.Tr("setting.twofa_is_enrolled")) + ctx.Flash.Error(ctx.Tr("settings.twofa_is_enrolled")) ctx.Redirect(setting.AppSubURL + "/user/settings/security") return } From 8bc8b9b776fc45f5bcce4dbacf1acc23166083cc Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 25 Sep 2021 15:02:07 +0200 Subject: [PATCH 2/2] fix all --- routers/web/user/setting/keys.go | 2 +- routers/web/user/setting/security_twofa.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/web/user/setting/keys.go b/routers/web/user/setting/keys.go index bb7a50841bb8a..22a0fe474171f 100644 --- a/routers/web/user/setting/keys.go +++ b/routers/web/user/setting/keys.go @@ -209,7 +209,7 @@ func DeleteKey(ctx *context.Context) { return } if external { - ctx.Flash.Error(ctx.Tr("setting.ssh_externally_managed")) + ctx.Flash.Error(ctx.Tr("settings.ssh_externally_managed")) ctx.Redirect(setting.AppSubURL + "/user/settings/keys") return } diff --git a/routers/web/user/setting/security_twofa.go b/routers/web/user/setting/security_twofa.go index 4d9c41489ca8e..b2530f52fe6ea 100644 --- a/routers/web/user/setting/security_twofa.go +++ b/routers/web/user/setting/security_twofa.go @@ -32,7 +32,7 @@ func RegenerateScratchTwoFactor(ctx *context.Context) { t, err := models.GetTwoFactorByUID(ctx.User.ID) if err != nil { if models.IsErrTwoFactorNotEnrolled(err) { - ctx.Flash.Error(ctx.Tr("setting.twofa_not_enrolled")) + ctx.Flash.Error(ctx.Tr("settings.twofa_not_enrolled")) ctx.Redirect(setting.AppSubURL + "/user/settings/security") } ctx.ServerError("SettingsTwoFactor: Failed to GetTwoFactorByUID", err) @@ -62,7 +62,7 @@ func DisableTwoFactor(ctx *context.Context) { t, err := models.GetTwoFactorByUID(ctx.User.ID) if err != nil { if models.IsErrTwoFactorNotEnrolled(err) { - ctx.Flash.Error(ctx.Tr("setting.twofa_not_enrolled")) + ctx.Flash.Error(ctx.Tr("settings.twofa_not_enrolled")) ctx.Redirect(setting.AppSubURL + "/user/settings/security") } ctx.ServerError("SettingsTwoFactor: Failed to GetTwoFactorByUID", err)