Skip to content

Commit 14b4430

Browse files
Merge branch 'main' into feature/actions_unit
2 parents e68ae8f + c2ff2a4 commit 14b4430

File tree

214 files changed

+4276
-1867
lines changed

Some content is hidden

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

214 files changed

+4276
-1867
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Jimmy Praet <[email protected]> (@jpraet)
4444
Leon Hofmeister <[email protected]> (@delvh)
4545
Wim <[email protected]> (@42wim)
4646
Jason Song <[email protected]> (@wolfogre)
47-
Yarden Shoham <hrsi88@gmail.com> (@yardenshoham)
47+
Yarden Shoham <git@yardenshoham.com> (@yardenshoham)
4848
Yu Tian <[email protected]> (@Zettat123)
4949
Eddie Yang <[email protected]> (@yp05327)
5050
Dong Ge <[email protected]> (@sillyguodong)

assets/go-licenses.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/backport-locales.go

Lines changed: 30 additions & 4 deletions
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,10 +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-
// A bug: many of new translations with ";" are broken in Crowdin (due to last messy restoring)
81-
// As the broken strings are gradually fixed, this workaround check could be removed (in a few months?)
82-
if strings.Contains(oldStr, ";") && !strings.Contains(newStr, ";") {
83-
println("skip potential broken string", path, secEnUS.Name(), keyEnUs.Name())
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"))
8489
continue
8590
}
8691
secOld.Key(keyEnUs.Name()).SetValue(newStr)
@@ -89,4 +94,25 @@ func main() {
8994
}
9095
mustNoErr(iniOld.SaveTo(path))
9196
}
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+
}
92118
}

build/generate-emoji.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ func main() {
6060
// generate data
6161
buf, err := generate()
6262
if err != nil {
63-
log.Fatal(err)
63+
log.Fatalf("generate err: %v", err)
6464
}
6565

6666
// write
6767
err = os.WriteFile(*flagOut, buf, 0o644)
6868
if err != nil {
69-
log.Fatal(err)
69+
log.Fatalf("WriteFile err: %v", err)
7070
}
7171
}
7272

build/update-locales.sh

Lines changed: 4 additions & 11 deletions
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

0 commit comments

Comments
 (0)