aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-01-02 11:33:57 +0800
committerGitHub <noreply@github.com>2022-01-02 04:33:57 +0100
commite61b390d545919244141b699b28e3fbc42adc66f (patch)
treede17418a260234e1043a6d3a130c2b4a8c27640a /routers/web/repo/setting.go
parent88da7a7174f9c1568cc2d8d084d6b05a8d268690 (diff)
downloadgitea-e61b390d545919244141b699b28e3fbc42adc66f.tar.gz
gitea-e61b390d545919244141b699b28e3fbc42adc66f.zip
Unify and simplify TrN for i18n (#18141)
Refer: https://github.com/go-gitea/gitea/pull/18135#issuecomment-1003246099 Now we have a unique and simple `TrN`, and make the fix of PR #18135 also use the better `TrN` logic.
Diffstat (limited to 'routers/web/repo/setting.go')
-rw-r--r--routers/web/repo/setting.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go
index 57a195ee62..7ff83cc3d7 100644
--- a/routers/web/repo/setting.go
+++ b/routers/web/repo/setting.go
@@ -610,11 +610,8 @@ func SettingsPost(ctx *context.Context) {
if !ctx.Repo.Owner.CanCreateRepo() {
maxCreationLimit := ctx.Repo.Owner.MaxCreationLimit()
- if maxCreationLimit == 1 {
- ctx.Flash.Error(ctx.Tr("repo.form.reach_limit_of_creation_1", maxCreationLimit))
- } else {
- ctx.Flash.Error(ctx.Tr("repo.form.reach_limit_of_creation_n", maxCreationLimit))
- }
+ msg := ctx.TrN(maxCreationLimit, "repo.form.reach_limit_of_creation_1", "repo.form.reach_limit_of_creation_n", maxCreationLimit)
+ ctx.Flash.Error(msg)
ctx.Redirect(repo.Link() + "/settings")
return
}