mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-26 12:45:54 +00:00
feat(build): improve lint-locale-usage further (#8736)
Print out a list of all unused msgids Handle Go files that make calls to translation. Handle `models/unit/unit.go`, which stores msgids in `$Unit.NameKey` Handle .locale.Tr in templates Handle simple dynamically constructed `Tr("msgid-prefix." + SomeFunctionCall())`. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8736 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Ellen Εμιλία Άννα Zscheile <fogti+devel@ytrizja.de> Co-committed-by: Ellen Εμιλία Άννα Zscheile <fogti+devel@ytrizja.de>
This commit is contained in:
parent
e101a8e2dd
commit
f447661345
18 changed files with 720 additions and 320 deletions
|
@ -35,7 +35,7 @@ func HandleGitError(ctx *context.Context, msg string, err error) {
|
|||
case ctx.Repo.IsViewCommit:
|
||||
refType = "commit"
|
||||
}
|
||||
ctx.Data["NotFoundPrompt"] = ctx.Locale.Tr("repo.tree_path_not_found_"+refType, ctx.Repo.TreePath, url.PathEscape(ctx.Repo.RefName))
|
||||
ctx.Data["NotFoundPrompt"] = ctx.Locale.Tr("repo.tree_path_not_found."+refType, ctx.Repo.TreePath, url.PathEscape(ctx.Repo.RefName))
|
||||
ctx.Data["NotFoundGoBackURL"] = ctx.Repo.RepoLink + "/src/" + refType + "/" + url.PathEscape(ctx.Repo.RefName)
|
||||
ctx.NotFound(msg, err)
|
||||
} else {
|
||||
|
|
|
@ -35,7 +35,7 @@ func TaskStatus(ctx *context.Context) {
|
|||
var translatableMessage admin_model.TranslatableMessage
|
||||
if err := json.Unmarshal([]byte(message), &translatableMessage); err != nil {
|
||||
translatableMessage = admin_model.TranslatableMessage{
|
||||
Format: "migrate.migrating_failed.error",
|
||||
Format: "repo.migrate.migrating_failed.error",
|
||||
Args: []any{task.Message},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue