diff options
Diffstat (limited to 'routers/web/repo/repo.go')
-rw-r--r-- | routers/web/repo/repo.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/routers/web/repo/repo.go b/routers/web/repo/repo.go index 9a36e6ee1d..0d8c6d374f 100644 --- a/routers/web/repo/repo.go +++ b/routers/web/repo/repo.go @@ -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) |