loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(repo,locale): merge PR/issues cases for some repo/issue strings (#7092)

- Merge `archive.nocomment` and `comment.blocked_by_user`'s variants for issue and pull request to a unified string and no longer have a issue and pull request variant.
- Fixes #6443

Signed-off-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7092
Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>

+11 -29
+2 -4
options/locale/locale_en-US.ini
··· 1217 1217 1218 1218 archive.title = This repository is archived. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments. 1219 1219 archive.title_date = This repository has been archived on %s. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments. 1220 - archive.issue.nocomment = This repository is archived. You cannot comment on issues. 1221 - archive.pull.nocomment = This repository is archived. You cannot comment on pull requests. 1220 + archive.nocomment = Commenting is not possible because the repository is archived. 1222 1221 archive.pull.noreview = This repository is archived. You cannot review pull requests. 1223 1222 1224 1223 form.reach_limit_of_creation_1 = The owner has already reached the limit of %d repository. ··· 1882 1881 issues.content_history.options = Options 1883 1882 issues.reference_link = Reference: %s 1884 1883 issues.blocked_by_user = You cannot create issues in this repository because you are blocked by the repository owner. 1885 - issues.comment.blocked_by_user = You cannot comment on this issue because you are blocked by the repository owner or the poster of the issue. 1884 + comment.blocked_by_user = Commenting is not possible because you are blocked by the repository owner or the author. 1886 1885 issues.reopen.blocked_by_user = You cannot reopen this issue because you are blocked by the repository owner or the poster of this issue. 1887 1886 issues.summary_card_alt = Summary card of an issue titled "%s" in repository %s 1888 1887 ··· 1967 1966 pulls.waiting_count_n = %d waiting reviews 1968 1967 pulls.wrong_commit_id = commit id must be a commit id on the target branch 1969 1968 pulls.blocked_by_user = You cannot create a pull request on this repository because you are blocked by the repository owner. 1970 - pulls.comment.blocked_by_user = You cannot comment on this pull request because you are blocked by the repository owner or the poster of the pull request. 1971 1969 1972 1970 pulls.no_merge_desc = This pull request cannot be merged because all repository merge options are disabled. 1973 1971 pulls.no_merge_helper = Enable merge options in the repository settings or merge the pull request manually.
+1 -5
routers/web/repo/issue.go
··· 3255 3255 comment, err := issue_service.CreateIssueComment(ctx, ctx.Doer, ctx.Repo.Repository, issue, form.Content, attachments) 3256 3256 if err != nil { 3257 3257 if errors.Is(err, user_model.ErrBlockedByUser) { 3258 - if issue.IsPull { 3259 - ctx.JSONError(ctx.Tr("repo.pulls.comment.blocked_by_user")) 3260 - } else { 3261 - ctx.JSONError(ctx.Tr("repo.issues.comment.blocked_by_user")) 3262 - } 3258 + ctx.JSONError(ctx.Tr("repo.comment.blocked_by_user")) 3263 3259 } else { 3264 3260 ctx.ServerError("CreateIssueComment", err) 3265 3261 }
+2 -2
routers/web/repo/pull.go
··· 1321 1321 } else if models.IsErrMergeConflicts(err) { 1322 1322 conflictError := err.(models.ErrMergeConflicts) 1323 1323 flashError, err := ctx.RenderToHTML(tplAlertDetails, map[string]any{ 1324 - "Message": ctx.Tr("repo.editor.merge_conflict"), 1325 - "Summary": ctx.Tr("repo.editor.merge_conflict_summary"), 1324 + "Message": ctx.Tr("repo.pulls.merge_conflict"), 1325 + "Summary": ctx.Tr("repo.pulls.merge_conflict_summary"), 1326 1326 "Details": utils.SanitizeFlashErrorString(conflictError.StdErr) + "<br>" + utils.SanitizeFlashErrorString(conflictError.StdOut), 1327 1327 }) 1328 1328 if err != nil {
+3 -15
templates/repo/issue/view_content.tmpl
··· 116 116 </div> 117 117 {{else if .Repository.IsArchived}} 118 118 <div class="ui warning message tw-text-center"> 119 - {{if .Issue.IsPull}} 120 - {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} 121 - {{else}} 122 - {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} 123 - {{end}} 119 + {{ctx.Locale.Tr "repo.archive.nocomment"}} 124 120 </div> 125 121 {{end}} 126 122 {{else if .IsBlocked}} 127 123 <div class="ui warning message"> 128 - {{if .Issue.IsPull}} 129 - {{ctx.Locale.Tr "repo.pulls.comment.blocked_by_user"}} 130 - {{else}} 131 - {{ctx.Locale.Tr "repo.issues.comment.blocked_by_user"}} 132 - {{end}} 124 + {{ctx.Locale.Tr "repo.comment.blocked_by_user"}} 133 125 </div> 134 126 {{else}} {{/* not .IsSigned */}} 135 127 {{if .Repository.IsArchived}} 136 128 <div class="ui warning message tw-text-center"> 137 - {{if .Issue.IsPull}} 138 - {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} 139 - {{else}} 140 - {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} 141 - {{end}} 129 + {{ctx.Locale.Tr "repo.archive.nocomment"}} 142 130 </div> 143 131 {{else}} 144 132 <div class="ui warning message">
+3 -3
tests/integration/block_test.go
··· 236 236 // Ensures that comment creation on doer's owned repositories and doer's 237 237 // posted issues are blocked. 238 238 t.Run("Comment creation", func(t *testing.T) { 239 - expectedMessage := locale.Tr("repo.issues.comment.blocked_by_user") 239 + expectedMessage := locale.Tr("repo.comment.blocked_by_user") 240 240 241 241 t.Run("Blocked by repository owner", func(t *testing.T) { 242 242 defer tests.PrintCurrentTest(t)() ··· 258 258 resp = session.MakeRequest(t, req, http.StatusOK) 259 259 htmlDoc := NewHTMLParser(t, resp.Body) 260 260 msg := htmlDoc.doc.Find("div .warning").Text() 261 - assert.Contains(t, msg, "You cannot comment on this issue because you are blocked") 261 + assert.Contains(t, msg, expectedMessage) 262 262 }) 263 263 264 264 t.Run("Blocked by issue poster", func(t *testing.T) { ··· 285 285 resp = session.MakeRequest(t, req, http.StatusOK) 286 286 htmlDoc := NewHTMLParser(t, resp.Body) 287 287 msg := htmlDoc.doc.Find("div .warning").Text() 288 - assert.Contains(t, msg, "You cannot comment on this issue because you are blocked") 288 + assert.Contains(t, msg, expectedMessage) 289 289 }) 290 290 }) 291 291