From 28e5e7fcbca9cd2030c156ec45f6f3cf67b3682e Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 30 Apr 2020 15:49:12 +0200 Subject: [PATCH] Add a 'this' to issue close/reopened messages (#11204) * add a 'this' to issue close/reopened messages * add 'this issue/pull request' and create new localization entries Co-authored-by: Lauris BH --- options/locale/locale_en-US.ini | 6 ++++-- templates/repo/issue/view_content/comments.tmpl | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index d85dc39a89..8d188e32e5 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -935,8 +935,8 @@ issues.close_comment_issue = Comment and Close issues.reopen_issue = Reopen issues.reopen_comment_issue = Comment and Reopen issues.create_comment = Comment -issues.closed_at = `closed %[2]s` -issues.reopened_at = `reopened %[2]s` +issues.closed_at = `closed this issue %[2]s` +issues.reopened_at = `reopened this issue %[2]s` issues.commit_ref_at = `referenced this issue from a commit %[2]s` issues.ref_issue_from = `referenced this issue %[4]s %[2]s` issues.ref_pull_from = `referenced this pull request %[4]s %[2]s` @@ -1152,6 +1152,8 @@ pulls.update_branch = Update branch pulls.update_branch_success = Branch update was successful pulls.update_not_allowed = You are not allowed to update branch pulls.outdated_with_base_branch = This branch is out-of-date with the base branch +pulls.closed_at = `closed this pull request %[2]s` +pulls.reopened_at = `reopened this pull request %[2]s` milestones.new = New Milestone milestones.open_tab = %d Open diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 0353e10135..a3b4fb81e0 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -75,7 +75,11 @@ {{.Poster.GetDisplayName}} - {{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}} + {{if .Issue.IsPull }} + {{$.i18n.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}} + {{else}} + {{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}} + {{end}} {{else if eq .Type 2}} @@ -86,7 +90,11 @@ {{.Poster.GetDisplayName}} - {{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}} + {{if .Issue.IsPull }} + {{$.i18n.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}} + {{else}} + {{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}} + {{end}} {{else if eq .Type 28}}