mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-05-31 22:58:39 +00:00
substitute Gitea links in the translation files at build time
This commit is contained in:
parent
b94716c4e9
commit
dd7cca9a35
|
@ -45,8 +45,18 @@ func renameGiteaForgejo(filename string) []byte {
|
|||
line := scanner.Text()
|
||||
if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") {
|
||||
out = append(out, []byte("\n"+line+"\n")...)
|
||||
} else if strings.Contains(line, "Gitea") {
|
||||
out = append(out, []byte(strings.Replace(line, "Gitea", "Forgejo", -1)+"\n")...)
|
||||
} else {
|
||||
out = append(out, []byte(strings.NewReplacer(
|
||||
"Gitea", "Forgejo",
|
||||
"https://docs.gitea.io/en-us/install-from-binary/", "https://forgejo.org/download",
|
||||
"https://github.com/go-gitea/gitea/tree/master/docker", "https://forgejo.org/download",
|
||||
"https://docs.gitea.io/en-us/install-from-package/", "https://forgejo.org/download",
|
||||
"https://code.gitea.io/gitea", "https://forgejo.org/download",
|
||||
"code.gitea.io/gitea", "Forgejo",
|
||||
`<a href="https://github.com/go-gitea/gitea/issues" target="_blank">GitHub</a>`, `<a href="https://codeberg.org/forgejo/forgejo/issues" target="_blank">Codeberg</a>`,
|
||||
"https://github.com/go-gitea/gitea", "https://codeberg.org/forgejo/forgejo",
|
||||
"https://blog.gitea.io", "https://forgejo.org/news",
|
||||
).Replace(line)+"\n")...)
|
||||
}
|
||||
}
|
||||
file.Close()
|
||||
|
|
|
@ -185,7 +185,7 @@ func checkDatabase(ctx *context.Context, form *forms.InstallForm) bool {
|
|||
if err = db.InitEngine(ctx); err != nil {
|
||||
if strings.Contains(err.Error(), `Unknown database type: sqlite3`) {
|
||||
ctx.Data["Err_DbType"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://docs.gitea.io/en-us/install-from-binary/"), tplInstall, form)
|
||||
ctx.RenderWithErr(ctx.Tr("install.sqlite3_not_available", "https://forgejo.org/download#installation-from-binary"), tplInstall, form)
|
||||
} else {
|
||||
ctx.Data["Err_DbSetting"] = true
|
||||
ctx.RenderWithErr(ctx.Tr("install.invalid_db_setting", err), tplInstall, form)
|
||||
|
|
Loading…
Reference in a new issue