[I18N] in the home page replace GitHub with Forgejo

The english string that shows on the home page to encourage for
contribution no longer reference GitHub. But some translations still
do. In this context, and this context only, replace it with Forgejo
even though it may not be correct in some cases.

Refs: https://codeberg.org/forgejo/forgejo/pulls/450
This commit is contained in:
Loïc Dachary 2023-03-05 15:55:39 +01:00
parent c728ce8b32
commit 71de77f5ae
No known key found for this signature in database
GPG key ID: 992D23B392F9E4F2

View file

@ -56,6 +56,11 @@ func renameGiteaForgejo(filename string) []byte {
scanner.Split(bufio.ScanLines) scanner.Split(bufio.ScanLines)
for scanner.Scan() { for scanner.Scan() {
line := scanner.Text() line := scanner.Text()
if strings.HasPrefix(line, "license_desc=") {
line = strings.Replace(line, "GitHub", "Forgejo", 1)
}
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") { if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
out = append(out, []byte("\n"+line+"\n")...) out = append(out, []byte("\n"+line+"\n")...)
} else if strings.HasPrefix(line, "settings.web_hook_name_gitea") { } else if strings.HasPrefix(line, "settings.web_hook_name_gitea") {