Skip to content

Commit 6832a8e

Browse files
authored
Add locale for deleted head branch (#26296)
As title. It will be displayed in: ![image](https://github.com/go-gitea/gitea/assets/18380374/e8507a3b-14f4-4418-a347-a36689707a16)
1 parent 70647bd commit 6832a8e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

options/locale/locale_en-US.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,6 +1784,8 @@ pulls.delete.text = Do you really want to delete this pull request? (This will p
17841784

17851785
pulls.recently_pushed_new_branches = You pushed on branch <strong>%[1]s</strong> %[2]s
17861786

1787+
pull.deleted_branch = (deleted):%s
1788+
17871789
milestones.new = New Milestone
17881790
milestones.closed = Closed %s
17891791
milestones.update_ago = Updated %s

routers/web/repo/pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
610610
if pull.IsSameRepo() {
611611
ctx.Data["HeadTarget"] = pull.HeadBranch
612612
} else if pull.HeadRepo == nil {
613-
ctx.Data["HeadTarget"] = "<deleted>:" + pull.HeadBranch
613+
ctx.Data["HeadTarget"] = ctx.Locale.Tr("repo.pull.deleted_branch", pull.HeadBranch)
614614
} else {
615615
ctx.Data["HeadTarget"] = pull.HeadRepo.OwnerName + ":" + pull.HeadBranch
616616
}
@@ -654,7 +654,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *issues_model.Issue) *git.C
654654
if pull.IsSameRepo() {
655655
ctx.Data["HeadTarget"] = pull.HeadBranch
656656
} else if pull.HeadRepo == nil {
657-
ctx.Data["HeadTarget"] = "<deleted>:" + pull.HeadBranch
657+
ctx.Data["HeadTarget"] = ctx.Locale.Tr("repo.pull.deleted_branch", pull.HeadBranch)
658658
} else {
659659
ctx.Data["HeadTarget"] = pull.HeadRepo.OwnerName + ":" + pull.HeadBranch
660660
}

0 commit comments

Comments
 (0)