You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules
Yarden Shoham 70bb4984cd
Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275)
This refactors the `shared/datetime/short|long|full` templates into a
template helper function, which allows us to render absolute date times
within translatable phrases.

- Follows #23988
- The first attempt was in #24055
- This should help #22664 

Changes:
1. Added the `DateTime` template helper that replaces the
`shared/datetime/short|long|full` templates
2. Used find-and-replace with varying regexes to replace the templates
from step 1 (for example, `\{\{template "shared/datetime/(\S+) \(dict
"Datetime" ([^"]+) "Fallback" ([^\)]+\)?) ?\)?\}\}` -> `{{DateTime "$1
$2 $3}}`)
3. Used the new `DateTime` helper in the issue due date timestamp
rendering

# Before

![image](https://user-images.githubusercontent.com/20454870/233791256-b454c455-aca0-4b76-b300-7866c7bd529e.png)

# After

![image](https://user-images.githubusercontent.com/20454870/233790809-c4913355-2822-4657-bb29-2298deb6d4b3.png)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago
..
actions show workflow config error on file view also (#24267) 2 years ago
activitypub Add Chef package registry (#22554) 2 years ago
analyze Implement FSFE REUSE for golang files (#21840) 2 years ago
assetfs Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
auth Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
avatar Allow `webp` images as avatars (#24248) 2 years ago
base Use a general Eval function for expressions in templates. (#23927) 2 years ago
cache Update redis library to support redis v7 (#24114) 2 years ago
charset Update go tool dependencies, restructure lint targets (#24239) 2 years ago
container Implement FSFE REUSE for golang files (#21840) 2 years ago
context Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) 2 years ago
csv Refactor locale number (#24134) 2 years ago
doctor Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
emoji Fix unstable emoji sort (#22346) 2 years ago
eventsource Move `convert` package to services (#22264) 2 years ago
generate Implement FSFE REUSE for golang files (#21840) 2 years ago
git Use more specific test methods (#24265) 2 years ago
gitgraph Add context cache as a request level cache (#22294) 2 years ago
graceful Remove most path-based golangci exclusions (#24214) 2 years ago
hcaptcha Consume hcaptcha and pwn deps (#22610) 2 years ago
highlight test_env: hardcode major go version in use (#23464) 2 years ago
hostmatcher Implement FSFE REUSE for golang files (#21840) 2 years ago
html Implement FSFE REUSE for golang files (#21840) 2 years ago
httpcache Set `X-Gitea-Debug` header once (#23361) 2 years ago
httplib Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 2 years ago
indexer Use more specific test methods (#24265) 2 years ago
issue/template Allow issue templates to not render title (#22589) 2 years ago
json Update gitea-vet to check FSFE REUSE (#22004) 2 years ago
label Make label templates have consistent behavior and priority (#23749) 2 years ago
lfs Use more specific test methods (#24265) 2 years ago
log Use more specific test methods (#24265) 2 years ago
markup Use more specific test methods (#24265) 2 years ago
mcaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
metrics include build info in Prometheus metrics (#22819) 2 years ago
migration Scoped labels (#22585) 2 years ago
mirror Implement FSFE REUSE for golang files (#21840) 2 years ago
nosql Update redis library to support redis v7 (#24114) 2 years ago
notification Implement actions (#21937) 2 years ago
options Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
packages Use more specific test methods (#24265) 2 years ago
paginator Use more specific test methods (#24265) 2 years ago
pprof Implement FSFE REUSE for golang files (#21840) 2 years ago
private Fix incorrect internal response type (#24173) 2 years ago
process Improve trace logging for pulls and processes (#22633) 2 years ago
proxy Use proxy for pull mirror (#22771) 2 years ago
proxyprotocol Implement FSFE REUSE for golang files (#21840) 2 years ago
public Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
queue Use more specific test methods (#24265) 2 years ago
recaptcha Implement FSFE REUSE for golang files (#21840) 2 years ago
references Use correct captured group range when parsing cross-reference (#22672) 2 years ago
regexplru Implement FSFE REUSE for golang files (#21840) 2 years ago
repository Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
secret Use more specific test methods (#24265) 2 years ago
session Update redis library to support redis v7 (#24114) 2 years ago
setting Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) 2 years ago
sitemap Fix sitemap (#22272) 2 years ago
ssh Implement FSFE REUSE for golang files (#21840) 2 years ago
storage Use more specific test methods (#24265) 2 years ago
structs Fix Org edit page bugs: renaming detection, maxlength (#24161) 2 years ago
svg Use a general approach to access custom/static/builtin assets (#24022) 2 years ago
sync Implement FSFE REUSE for golang files (#21840) 2 years ago
system Implement FSFE REUSE for golang files (#21840) 2 years ago
templates Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275) 2 years ago
test Use more specific test methods (#24265) 2 years ago
timeutil Allow using localized absolute date times within phrases with place holders and localize issue due date events (#24275) 2 years ago
translation Use more specific test methods (#24265) 2 years ago
turnstile Add new captcha: cloudflare turnstile (#22369) 2 years ago
typesniffer Do not recognize text files as audio (#23355) 2 years ago
updatechecker Implement FSFE REUSE for golang files (#21840) 2 years ago
upload Implement FSFE REUSE for golang files (#21840) 2 years ago
uri Implement FSFE REUSE for golang files (#21840) 2 years ago
user Implement FSFE REUSE for golang files (#21840) 2 years ago
util Use more specific test methods (#24265) 2 years ago
validation Map OIDC groups to Orgs/Teams (#21441) 2 years ago
web Refactor web route (#24080) 2 years ago
webhook Restructure `webhook` module (#22256) 2 years ago