1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-23 01:48:27 +00:00

Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152)

- Backport #18135
- Backport #18153
This commit is contained in:
Gusted
2022-01-02 02:39:23 +00:00
committed by GitHub
parent 7e084341fe
commit f9bbed028c
3 changed files with 22 additions and 3 deletions

View File

@@ -533,7 +533,12 @@ func SettingsPost(ctx *context.Context) {
}
if !ctx.Repo.Owner.CanCreateRepo() {
ctx.Flash.Error(ctx.Tr("repo.form.reach_limit_of_creation", ctx.User.MaxCreationLimit()))
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))
}
ctx.Redirect(repo.Link() + "/settings")
return
}