1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Use correct translation key (#18135)

- Resolves #18122

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Gusted
2021-12-31 08:43:03 +00:00
committed by GitHub
parent a3d685077f
commit 7eb380baa4
3 changed files with 22 additions and 3 deletions

View File

@@ -162,7 +162,14 @@ func Create(ctx *context.Context) {
func handleCreateError(ctx *context.Context, owner *user_model.User, err error, name string, tpl base.TplName, form interface{}) {
switch {
case repo_model.IsErrReachLimitOfRepo(err):
ctx.RenderWithErr(ctx.Tr("repo.form.reach_limit_of_creation", owner.MaxCreationLimit()), tpl, form)
var msg string
maxCreationLimit := ctx.User.MaxCreationLimit()
if maxCreationLimit == 1 {
msg = ctx.Tr("repo.form.reach_limit_of_creation_1", maxCreationLimit)
} else {
msg = ctx.Tr("repo.form.reach_limit_of_creation_n", maxCreationLimit)
}
ctx.RenderWithErr(msg, tpl, form)
case repo_model.IsErrRepoAlreadyExist(err):
ctx.Data["Err_RepoName"] = true
ctx.RenderWithErr(ctx.Tr("form.repo_name_been_taken"), tpl, form)