forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
* upstream/main: Fix incorrect `HookEventType` of pull request review comments (go-gitea#23650) [skip ci] Updated translations via Crowdin Fix codeblocks in the cheat sheet (go-gitea#23664) Drop migration for ForeignReference (go-gitea#23605) Fix new issue/pull request btn margin when it is next to sort (go-gitea#23647) A tool to help to backport locales, changes source strings to fix other broken translations (go-gitea#23633) Fix incorrect `show-modal` and `show-panel` class (go-gitea#23660) Restructure documentation. Now the documentation has installation, administration, usage, development, contributing the 5 main parts (go-gitea#23629) Check LFS/Packages settings in dump and doctor command (go-gitea#23631) Use a general approach to show tooltip, fix temporary tooltip bug (go-gitea#23574) Improve workflow event triggers (go-gitea#23613) Improve `<SvgIcon>` to make it output `svg` node and optimize performance (go-gitea#23570)
- Loading branch information
Showing
165 changed files
with
758 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
//go:build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
"strings" | ||
|
||
"gopkg.in/ini.v1" | ||
) | ||
|
||
func main() { | ||
if len(os.Args) != 2 { | ||
println("usage: backport-locales <to-ref>") | ||
println("eg: backport-locales release/v1.19") | ||
os.Exit(1) | ||
} | ||
|
||
ini.PrettyFormat = false | ||
mustNoErr := func(err error) { | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
collectInis := func(ref string) map[string]*ini.File { | ||
inis := map[string]*ini.File{} | ||
err := filepath.WalkDir("options/locale", func(path string, d os.DirEntry, err error) error { | ||
if err != nil { | ||
return err | ||
} | ||
if d.IsDir() || !strings.HasSuffix(d.Name(), ".ini") { | ||
return nil | ||
} | ||
cfg, err := ini.LoadSources(ini.LoadOptions{ | ||
IgnoreInlineComment: true, | ||
UnescapeValueCommentSymbols: true, | ||
}, path) | ||
mustNoErr(err) | ||
inis[path] = cfg | ||
fmt.Printf("collecting: %s @ %s\n", path, ref) | ||
return nil | ||
}) | ||
mustNoErr(err) | ||
return inis | ||
} | ||
|
||
// collect new locales from current working directory | ||
inisNew := collectInis("HEAD") | ||
|
||
// switch to the target ref, and collect the old locales | ||
cmd := exec.Command("git", "checkout", os.Args[1]) | ||
cmd.Stdout = os.Stdout | ||
cmd.Stderr = os.Stderr | ||
mustNoErr(cmd.Run()) | ||
inisOld := collectInis(os.Args[1]) | ||
|
||
// use old en-US as the base, and copy the new translations to the old locales | ||
enUsOld := inisOld["options/locale/locale_en-US.ini"] | ||
for path, iniOld := range inisOld { | ||
if iniOld == enUsOld { | ||
continue | ||
} | ||
iniNew := inisNew[path] | ||
if iniNew == nil { | ||
continue | ||
} | ||
for _, secEnUS := range enUsOld.Sections() { | ||
secOld := iniOld.Section(secEnUS.Name()) | ||
secNew := iniNew.Section(secEnUS.Name()) | ||
for _, keyEnUs := range secEnUS.Keys() { | ||
if secNew.HasKey(keyEnUs.Name()) { | ||
oldStr := secOld.Key(keyEnUs.Name()).String() | ||
newStr := secNew.Key(keyEnUs.Name()).String() | ||
// A bug: many of new translations with ";" are broken in Crowdin (due to last messy restoring) | ||
// As the broken strings are gradually fixed, this workaround check could be removed (in a few months?) | ||
if strings.Contains(oldStr, ";") && !strings.Contains(newStr, ";") { | ||
println("skip potential broken string", path, secEnUS.Name(), keyEnUs.Name()) | ||
continue | ||
} | ||
secOld.Key(keyEnUs.Name()).SetValue(newStr) | ||
} | ||
} | ||
} | ||
mustNoErr(iniOld.SaveTo(path)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
date: "2016-12-01T16:00:00+02:00" | ||
title: "Administration" | ||
slug: "administration" | ||
weight: 30 | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
name: "Administration" | ||
weight: 20 | ||
collapse: true | ||
identifier: "administration" | ||
--- |
6 changes: 3 additions & 3 deletions
6
docs/content/doc/advanced.fr-fr.md → docs/content/doc/administration.fr-fr.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
--- | ||
date: "2017-08-23T09:00:00+02:00" | ||
title: "Avancé" | ||
slug: "advanced" | ||
slug: "administration" | ||
weight: 30 | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
name: "Avancé" | ||
weight: 40 | ||
identifier: "advanced" | ||
weight: 20 | ||
identifier: "administration" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
date: "2016-12-01T16:00:00+02:00" | ||
title: "运维" | ||
slug: "administration" | ||
weight: 30 | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
name: "运维" | ||
weight: 20 | ||
identifier: "administration" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
date: "2016-12-01T16:00:00+02:00" | ||
title: "運維" | ||
slug: "administration" | ||
weight: 30 | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
name: "運維" | ||
weight: 20 | ||
identifier: "administration" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.