Skip to content

Commit aadecb9

Browse files
authored
Merge branch 'main' into #23701
2 parents 4396af7 + 0983b23 commit aadecb9

File tree

248 files changed

+2978
-1918
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+2978
-1918
lines changed

.drone.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ steps:
726726

727727
# TODO: We should probably build all dependencies into a test image
728728
- name: test-e2e
729-
image: mcr.microsoft.com/playwright:v1.31.2-focal
729+
image: mcr.microsoft.com/playwright:v1.32.1-focal
730730
commands:
731731
- curl -sLO https://go.dev/dl/go1.20.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
732732
- groupadd --gid 1001 gitea && useradd -m --gid 1001 --uid 1001 gitea

.eslintrc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ rules:
164164
jquery/no-parse-html: [2]
165165
jquery/no-prop: [0]
166166
jquery/no-proxy: [2]
167-
jquery/no-ready: [0]
167+
jquery/no-ready: [2]
168168
jquery/no-serialize: [2]
169169
jquery/no-show: [2]
170170
jquery/no-size: [2]

.stylelintrc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ rules:
8888
no-invalid-position-at-import-rule: null
8989
no-irregular-whitespace: true
9090
no-unknown-animations: null
91+
no-unknown-custom-properties: null
9192
number-max-precision: null
9293
property-allowed-list: null
9394
property-disallowed-list: null

build.go

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2020 The Gitea Authors. All rights reserved.
22
// SPDX-License-Identifier: MIT
33

4-
54
//go:build vendor
65

76
package main

build/backport-locales.go

+30-5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func main() {
6262

6363
// use old en-US as the base, and copy the new translations to the old locales
6464
enUsOld := inisOld["options/locale/locale_en-US.ini"]
65+
brokenWarned := map[string]bool{}
6566
for path, iniOld := range inisOld {
6667
if iniOld == enUsOld {
6768
continue
@@ -77,11 +78,14 @@ func main() {
7778
if secNew.HasKey(keyEnUs.Name()) {
7879
oldStr := secOld.Key(keyEnUs.Name()).String()
7980
newStr := secNew.Key(keyEnUs.Name()).String()
80-
if oldStr != "" && strings.Count(oldStr, "%") != strings.Count(newStr, "%") {
81-
fmt.Printf("WARNING: locale %s [%s]%s has different number of arguments, skipping\n", path, secEnUS.Name(), keyEnUs.Name())
82-
fmt.Printf("\told: %s\n", oldStr)
83-
fmt.Printf("\tnew: %s\n", newStr)
84-
fmt.Println("---- ")
81+
broken := oldStr != "" && strings.Count(oldStr, "%") != strings.Count(newStr, "%")
82+
broken = broken || strings.Contains(oldStr, "\n") || strings.Contains(oldStr, "\n")
83+
if broken {
84+
brokenWarned[secOld.Name()+"."+keyEnUs.Name()] = true
85+
fmt.Println("----")
86+
fmt.Printf("WARNING: skip broken locale: %s , [%s] %s\n", path, secEnUS.Name(), keyEnUs.Name())
87+
fmt.Printf("\told: %s\n", strings.ReplaceAll(oldStr, "\n", "\\n"))
88+
fmt.Printf("\tnew: %s\n", strings.ReplaceAll(newStr, "\n", "\\n"))
8589
continue
8690
}
8791
secOld.Key(keyEnUs.Name()).SetValue(newStr)
@@ -90,4 +94,25 @@ func main() {
9094
}
9195
mustNoErr(iniOld.SaveTo(path))
9296
}
97+
98+
fmt.Println("========")
99+
100+
for path, iniNew := range inisNew {
101+
for _, sec := range iniNew.Sections() {
102+
for _, key := range sec.Keys() {
103+
str := sec.Key(key.Name()).String()
104+
broken := strings.Contains(str, "\n")
105+
broken = broken || strings.HasPrefix(str, "`") != strings.HasSuffix(str, "`")
106+
broken = broken || strings.HasPrefix(str, "\"`")
107+
broken = broken || strings.HasPrefix(str, "`\"")
108+
broken = broken || strings.Count(str, `"`)%2 == 1
109+
broken = broken || strings.Count(str, "`")%2 == 1
110+
if broken && !brokenWarned[sec.Name()+"."+key.Name()] {
111+
fmt.Printf("WARNING: found broken locale: %s , [%s] %s\n", path, sec.Name(), key.Name())
112+
fmt.Printf("\tstr: %s\n", strings.ReplaceAll(str, "\n", "\\n"))
113+
fmt.Println("----")
114+
}
115+
}
116+
}
117+
}
93118
}

build/update-locales.sh

+4-11
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,10 @@ fi
1717

1818
mv ./options/locale/locale_en-US.ini ./options/
1919

20-
# the "ini" library for locale has many quirks
21-
# * `a="xx"` gets `xx` (no quote)
22-
# * `a=x\"y` gets `x\"y` (no unescaping)
23-
# * `a="x\"y"` gets `"x\"y"` (no unescaping, the quotes are still there)
24-
# * `a='x\"y'` gets `x\"y` (no unescaping, no quote)
25-
# * `a="foo` gets `"foo` (although the quote is not closed)
26-
# * 'a=`foo`' works like single-quote
27-
# crowdin needs the strings to be quoted correctly and doesn't like incomplete quotes
28-
# crowdin always outputs quoted strings if there are quotes in the strings.
29-
30-
# this script helps to unquote the crowdin outputs for the quirky ini library
20+
# the "ini" library for locale has many quirks, its behavior is different from Crowdin.
21+
# see i18n_test.go for more details
22+
23+
# this script helps to unquote the Crowdin outputs for the quirky ini library
3124
# * find all `key="...\"..."` lines
3225
# * remove the leading quote
3326
# * remove the trailing quote

custom/conf/app.example.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -947,10 +947,10 @@ ROUTER = console
947947
;USE_COMPAT_SSH_URI = false
948948
;;
949949
;; Close issues as long as a commit on any branch marks it as fixed
950-
;; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages
950+
;; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions.
951951
;DISABLED_REPO_UNITS =
952952
;;
953-
;; Comma separated list of default new repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages.
953+
;; Comma separated list of default new repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions.
954954
;; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility.
955955
;; External wiki and issue tracker can't be enabled by default as it requires additional settings.
956956
;; Disabled repo units will not be added to new repositories regardless if it is in the default list.

docs/content/doc/administration/adding-legal-pages.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-12-28"
33
title: "Adding Legal Pages"
44
slug: adding-legal-pages
5-
weight: 9
5+
weight: 110
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/cmd-embedded.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2020-01-25T21:00:00-03:00"
33
title: "Embedded data extraction tool"
44
slug: "cmd-embedded"
5-
weight: 40
5+
weight: 20
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/command-line.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2017-01-01T16:00:00+02:00"
33
title: "Usage: Command Line"
44
slug: "command-line"
5-
weight: 10
5+
weight: 1
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/config-cheat-sheet.en-us.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2016-12-26T16:00:00+02:00"
33
title: "Config Cheat Sheet"
44
slug: "config-cheat-sheet"
5-
weight: 20
5+
weight: 30
66
toc: false
77
draft: false
88
menu:
@@ -103,8 +103,8 @@ In addition there is _`StaticRootPath`_ which can be set as a built-in at build
103103
- `DEFAULT_CLOSE_ISSUES_VIA_COMMITS_IN_ANY_BRANCH`: **false**: Close an issue if a commit on a non default branch marks it as closed.
104104
- `ENABLE_PUSH_CREATE_USER`: **false**: Allow users to push local repositories to Gitea and have them automatically created for a user.
105105
- `ENABLE_PUSH_CREATE_ORG`: **false**: Allow users to push local repositories to Gitea and have them automatically created for an org.
106-
- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects\]
107-
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
106+
- `DISABLED_REPO_UNITS`: **_empty_**: Comma separated list of globally disabled repo units. Allowed values: \[repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki, repo.projects, repo.packages, repo.actions\]
107+
- `DEFAULT_REPO_UNITS`: **repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects,repo.packages**: Comma separated list of default new repo units. Allowed values: \[repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects, repo.packages, repo.actions\]. Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility. External wiki and issue tracker can't be enabled by default as it requires additional settings. Disabled repo units will not be added to new repositories regardless if it is in the default list.
108108
- `DEFAULT_FORK_REPO_UNITS`: **repo.code,repo.pulls**: Comma separated list of default forked repo units. The set of allowed values and rules is the same as `DEFAULT_REPO_UNITS`.
109109
- `PREFIX_ARCHIVE_FILES`: **true**: Prefix archive files by placing them in a directory named after the repository.
110110
- `DISABLE_MIGRATIONS`: **false**: Disable migrating feature.

docs/content/doc/administration/config-cheat-sheet.zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2016-12-26T16:00:00+02:00"
33
title: "配置说明"
44
slug: "config-cheat-sheet"
5-
weight: 20
5+
weight: 30
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/customizing-gitea.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2017-04-15T14:56:00+02:00"
33
title: "Customizing Gitea"
44
slug: "customizing-gitea"
5-
weight: 9
5+
weight: 100
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/customizing-gitea.zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2017-04-15T14:56:00+02:00"
33
title: "自定义 Gitea 配置"
44
slug: "customizing-gitea"
5-
weight: 9
5+
weight: 100
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/email-setup.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ SMTP_ADDR = smtp.gmail.com
8181
SMTP_PORT = 465
8282
8383
USER = example.user
84-
PASSWD = ***
84+
PASSWD = `***`
8585
MAILER_TYPE = smtp
8686
IS_TLS_ENABLED = true
8787
```

docs/content/doc/administration/environment-variables.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2017-04-08T11:34:00+02:00"
33
title: "Environment variables"
44
slug: "environment-variables"
5-
weight: 20
5+
weight: 10
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/environment-variables.zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2017-04-08T11:34:00+02:00"
33
title: "环境变量清单"
44
slug: "environment-variables"
5-
weight: 20
5+
weight: 10
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/external-renderers.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2018-11-23:00:00+02:00"
33
title: "External renderers"
44
slug: "external-renderers"
5-
weight: 40
5+
weight: 60
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/logging-documentation.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-04-02T17:06:00+01:00"
33
title: "Advanced: Logging Configuration"
44
slug: "logging-configuration"
5-
weight: 55
5+
weight: 40
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/mail-templates.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Currently, the following notification events make use of templates:
3939
| `approve` | The head comment of a approving review for a pull request. |
4040
| `reject` | The head comment of a review requesting changes for a pull request. |
4141
| `code` | A single comment on the code of a pull request. |
42-
| `assigned` | Used was assigned to an issue or pull request. |
42+
| `assigned` | User was assigned to an issue or pull request. |
4343
| `default` | Any action not included in the above categories, or when the corresponding category template is not present. |
4444

4545
The path for the template of a particular message type is:

docs/content/doc/administration/reverse-proxies.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2018-05-22T11:00:00+00:00"
33
title: "Usage: Reverse Proxies"
44
slug: "reverse-proxies"
5-
weight: 17
5+
weight: 16
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/reverse-proxies.zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2018-05-22T11:00:00+00:00"
33
title: "使用:反向代理"
44
slug: "reverse-proxies"
5-
weight: 17
5+
weight: 16
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/search-engines-indexation.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-12-31T13:55:00+05:00"
33
title: "Advanced: Search Engines Indexation"
44
slug: "search-engines-indexation"
5-
weight: 30
5+
weight: 60
66
toc: false
77
draft: false
88
menu:

docs/content/doc/administration/signing.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-08-17T10:20:00+01:00"
33
title: "GPG Commit Signatures"
44
slug: "signing"
5-
weight: 20
5+
weight: 50
66
toc: false
77
draft: false
88
menu:

docs/content/doc/contributing/localization.zh-cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2016-12-01T16:00:00+02:00"
33
title: "本地化"
44
slug: "localization"
5-
weight: 10
5+
weight: 20
66
toc: false
77
draft: false
88
menu:

docs/content/doc/contributing/localization.zh-tw.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2016-12-01T16:00:00+02:00"
33
title: "在地化"
44
slug: "localization"
5-
weight: 10
5+
weight: 20
66
toc: false
77
draft: false
88
menu:

docs/content/doc/contributing/translation.de-de.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2021-01-22T00:00:00+02:00"
33
title: "Übersetzungs Richtlinien"
4-
weight: 10
4+
weight: 70
55
toc: true
66
draft: false
77
menu:

docs/content/doc/contributing/translation.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: "2021-01-22T00:00:00+02:00"
33
title: "Translation Guidelines"
4-
weight: 10
4+
weight: 70
55
toc: true
66
draft: false
77
menu:

docs/content/doc/development/integrations.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-04-15T17:29:00+08:00"
33
title: "Integrations"
44
slug: "integrations"
5-
weight: 40
5+
weight: 65
66
toc: false
77
draft: false
88
menu:

docs/content/doc/development/integrations.zh-tw.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-04-15T17:29:00+08:00"
33
title: "整合"
44
slug: "integrations"
5-
weight: 40
5+
weight: 65
66
toc: false
77
draft: false
88
menu:

docs/content/doc/development/migrations.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-04-15T17:29:00+08:00"
33
title: "Migrations Interfaces"
44
slug: "migrations-interfaces"
5-
weight: 30
5+
weight: 55
66
toc: false
77
draft: false
88
menu:

docs/content/doc/development/migrations.zh-tw.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: "2019-04-15T17:29:00+08:00"
33
title: "遷移介面"
44
slug: "migrations-interfaces"
5-
weight: 30
5+
weight: 55
66
toc: false
77
draft: false
88
menu:

docs/content/doc/help/search.de-de.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
date: "2019-11-12T16:00:00+02:00"
33
title: "Search"
44
slug: "search"
5-
weight: 4
5+
weight: 1
66
toc: false
77
draft: false
88
sitemap:
9-
priority : 0.1
9+
priority : 1
1010
layout: "search"
1111
---
1212

docs/content/doc/help/search.en-us.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
date: "2019-11-12T16:00:00+02:00"
33
title: "Search"
44
slug: "search"
5-
weight: 4
5+
weight: 1
66
toc: false
77
draft: false
88
sitemap:
9-
priority : 0.1
9+
priority : 1
1010
layout: "search"
1111
---
1212

0 commit comments

Comments
 (0)