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

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-04-23 15:12:33 -04:00
3cc87370c3
Improve emoji and mention matching ( #24255 )
...
Prioritize matches that start with the given text, then matches that
contain the given text.
I wanted to add a heart emoji on a pull request comment so I started
writing `:`, `h`, `e`, `a`, `r` (at this point I still couldn't find the
heart), `t`... The heart was not on the list, that's weird - it feels
like I made a typo or a mistake. This fixes that.
This also feels more like GitHub's emoji auto-complete.
# Before

# After

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: silverwind <me@silverwind.io >
2023-04-22 11:32:34 -04:00
Yarden Shoham and GitHub
75b9845420
Mark public/img/svg/*.svg as generated files ( #24193 )
...
These files are generated using `make svg`
2023-04-18 13:52:18 -04:00
Yarden Shoham and GitHub
2002584986
Bump GitHub's relative-time-element to v4.3.0 ( #24187 )
...
https://github.com/github/relative-time-element/releases/tag/v4.3.0
I checked and everything still works
2023-04-19 00:00:01 +08:00
f045e58cc7
Localize activity heatmap (except tooltip) ( #24131 )
...
The calculation of the total sum is moved to the backend so a full HTML
string could be sent.

- Closes #10669
- 2nd attempt (the first was in #21570 )
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-04-17 14:26:01 -04:00
b4e952545b
Remove untranslatable on_date key ( #24106 )
...
- Follows #23988
- Fixes : #24074 by removing this key
GitHub's `relative-time` elements allow us to force their rendering to
`auto`, `past`, or `future` tense. We will never show an absolute date
`on ...` in `TimeSince`
## Before

## After

---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-04-15 13:01:54 +02:00
97176754be
Localize milestone related time strings ( #24051 )
...
- With #23988 in place, we can improve these timestamps
---------
Co-authored-by: silverwind <me@silverwind.io >
2023-04-12 02:29:49 -04:00
b7b5834831
Use auto-updating, natively hoverable, localized time elements ( #23988 )
...
- Added [GitHub's `relative-time` element](https://github.com/github/relative-time-element )
- Converted all formatted timestamps to use this element
- No more flashes of unstyled content around time elements
- These elements are localized using the `lang` property of the HTML file
- Relative (e.g. the activities in the dashboard) and duration (e.g.
server uptime in the admin page) time elements are auto-updated to keep
up with the current time without refreshing the page
- Code that is not needed anymore such as `formatting.js` and parts of `since.go` have been deleted
Replaces #21440
Follows #22861
## Screenshots
### Localized


### Tooltips
#### Native for dates

#### Interactive for relative

### Auto-update

---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: delvh <dev.lh@web.de >
2023-04-11 01:01:20 +02:00
Yarden Shoham and GitHub
42e009fa11
Reference the zh-CN version of reverse-proxies in https-support ( #24016 )
2023-04-09 17:31:31 +08:00
Yarden Shoham and GitHub
768ee158f5
Fix lint problem in https-support.zh-cn.md ( #24014 )
...
https://github.com/DavidAnson/markdownlint/blob/v0.26.2/doc/Rules.md#md051
2023-04-09 17:06:31 +08:00
Yarden Shoham and GitHub
518d384346
Remove docs from automatically building in Gitpod ( #23978 )
...
I couldn't find a way to build the docs without `trans-copy` and
spinning up a dev environment that generates files untracked by git on
startup is not a good development experience
Signed-off-by: Yarden Shoham <git@yardenshoham.com >
2023-04-07 15:55:25 -04:00
Yarden Shoham and GitHub
6a0ef71984
Yarden Shoham has a new email address ( #23767 )
...
Got a domain
2023-03-28 18:24:08 +08:00