]> source.dussan.org Git - gitea.git/commitdiff
Add locale for deleted head branch (#26296)
authoryp05327 <576951401@qq.com>
Thu, 3 Aug 2023 22:07:15 +0000 (07:07 +0900)
committerGitHub <noreply@github.com>
Thu, 3 Aug 2023 22:07:15 +0000 (22:07 +0000)
As title.

It will be displayed in:

![image](https://github.com/go-gitea/gitea/assets/18380374/e8507a3b-14f4-4418-a347-a36689707a16)

options/locale/locale_en-US.ini
routers/web/repo/pull.go

index ef940c83c812b500bfc83aa912fe6d5b61366bfd..24087cdd1bfa7589a54b5d1560b2c5b22856429d 100644 (file)
@@ -1784,6 +1784,8 @@ pulls.delete.text = Do you really want to delete this pull request? (This will p
 
 pulls.recently_pushed_new_branches = You pushed on branch <strong>%[1]s</strong> %[2]s
 
+pull.deleted_branch = (deleted):%s
+
 milestones.new = New Milestone
 milestones.closed = Closed %s
 milestones.update_ago = Updated %s
index d76e90bf248b89c06e8ffbd3b2af9e4933e79bfc..0be8bede74f0b54840bc808e1b6b0e69fc1e1b40 100644 (file)
@@ -610,7 +610,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
                        if pull.IsSameRepo() {
                                ctx.Data["HeadTarget"] = pull.HeadBranch
                        } else if pull.HeadRepo == nil {
-                               ctx.Data["HeadTarget"] = "<deleted>:" + pull.HeadBranch
+                               ctx.Data["HeadTarget"] = ctx.Locale.Tr("repo.pull.deleted_branch", pull.HeadBranch)
                        } else {
                                ctx.Data["HeadTarget"] = pull.HeadRepo.OwnerName + ":" + pull.HeadBranch
                        }
@@ -654,7 +654,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
                if pull.IsSameRepo() {
                        ctx.Data["HeadTarget"] = pull.HeadBranch
                } else if pull.HeadRepo == nil {
-                       ctx.Data["HeadTarget"] = "<deleted>:" + pull.HeadBranch
+                       ctx.Data["HeadTarget"] = ctx.Locale.Tr("repo.pull.deleted_branch", pull.HeadBranch)
                } else {
                        ctx.Data["HeadTarget"] = pull.HeadRepo.OwnerName + ":" + pull.HeadBranch
                }