mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user