diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-06-26 16:19:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-26 22:19:22 +0800 |
commit | 5d3f99c7c6d0f2c304dc13c6fa6aa675daf310cc (patch) | |
tree | b44b05216bef3051123cd6b2fd9495cee1b91ece /templates/repo/issue/view_content | |
parent | 711cbcce8d6a193f5738c45861d11cb86b412ec7 (diff) | |
download | gitea-5d3f99c7c6d0f2c304dc13c6fa6aa675daf310cc.tar.gz gitea-5d3f99c7c6d0f2c304dc13c6fa6aa675daf310cc.zip |
Make better use of i18n (#20096)
* Prototyping
* Start work on creating offsets
* Modify tests
* Start prototyping with actual MPH
* Twiddle around
* Twiddle around comments
* Convert templates
* Fix external languages
* Fix latest translation
* Fix some test
* Tidy up code
* Use simple map
* go mod tidy
* Move back to data structure
- Uses less memory by creating for each language a map.
* Apply suggestions from code review
Co-authored-by: delvh <dev.lh@web.de>
* Add some comments
* Fix tests
* Try to fix tests
* Use en-US as defacto fallback
* Use correct slices
* refactor (#4)
* Remove TryTr, add log for missing translation key
* Refactor i18n
- Separate dev and production locale stores.
- Allow for live-reloading in dev mode.
Co-authored-by: zeripath <art27@cantab.net>
* Fix live-reloading & check for errors
* Make linter happy
* live-reload with periodic check (#5)
* Fix tests
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates/repo/issue/view_content')
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/view_content/pull.tmpl | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 0258a9f969..2dbc34e029 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -1,7 +1,7 @@ {{ template "base/alert" }} {{range .Issue.Comments}} {{if call $.ShouldShowCommentType .Type}} - {{ $createdStr:= TimeSinceUnix .CreatedUnix $.i18n.Lang }} + {{ $createdStr:= TimeSinceUnix .CreatedUnix $.i18n }} <!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF, 5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING, @@ -152,7 +152,7 @@ {{else if eq .RefAction 2 }} {{ $refTr = "repo.issues.ref_reopening_from" }} {{end}} - {{ $createdStr:= TimeSinceUnix .CreatedUnix $.i18n.Lang }} + {{ $createdStr:= TimeSinceUnix .CreatedUnix $.i18n }} <div class="timeline-item event" id="{{.HashTag}}"> <span class="badge">{{svg "octicon-bookmark"}}</span> <a href="{{.Poster.HomeLink}}"> @@ -563,7 +563,7 @@ <div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}}"> <div class="ui comments mb-0"> {{range $comms}} - {{ $createdSubStr:= TimeSinceUnix .CreatedUnix $.i18n.Lang }} + {{ $createdSubStr:= TimeSinceUnix .CreatedUnix $.i18n }} <div class="comment code-comment pb-4" id="{{.HashTag}}"> <div class="content"> <div class="header comment-header"> diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 5a23bfa33b..e28eef30c2 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -4,7 +4,7 @@ <div class="ui segment"> <h4>{{$.i18n.Tr "repo.issues.review.reviewers"}}</h4> {{range .PullReviewers}} - {{ $createdStr:= TimeSinceUnix .Review.UpdatedUnix $.i18n.Lang }} + {{ $createdStr:= TimeSinceUnix .Review.UpdatedUnix $.i18n }} <div class="ui divider"></div> <div class="review-item"> <div class="review-item-left"> @@ -82,7 +82,7 @@ </div> {{end}} {{range .OriginalReviews}} - {{ $createdStr:= TimeSinceUnix .UpdatedUnix $.i18n.Lang }} + {{ $createdStr:= TimeSinceUnix .UpdatedUnix $.i18n }} <div class="ui divider"></div> <div class="review-item"> <div class="review-item-left"> @@ -328,7 +328,7 @@ {{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash}} {{$hasPendingPullRequestMergeTip := ""}} {{if .HasPendingPullRequestMerge}} - {{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix $.i18n.Lang}} + {{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix $.i18n}} {{$hasPendingPullRequestMergeTip = $.i18n.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}} {{end}} <div class="ui divider"></div> |