chore(i18n): migrate migration descriptions to json (#9041)

Followup to https://codeberg.org/forgejo/forgejo/pulls/8987

* migrate strings, get rid of the `repo.` prefix
* simplify template and test

Followup to https://codeberg.org/forgejo/forgejo/pulls/8736#issuecomment-6801385

* restore lost translations

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9041
Reviewed-by: Beowulf <beowulf@beocode.eu>
This commit is contained in:
0ko 2025-08-31 08:19:19 +02:00
commit af7066de64
63 changed files with 330 additions and 333 deletions

View file

@ -119,13 +119,9 @@ func TestRepoMigrationTypeSelect(t *testing.T) {
headers := page.Find(".migrate-entry h3").Text()
descriptions := page.Find(".migrate-entry .description").Text()
sourceNames := []string{"github", "gitea", "gitlab", "gogs", "onedev", "gitbucket", "codebase", "forgejo"}
sourceNames := []string{"github", "gitea", "gitlab", "gogs", "onedev", "gitbucket", "codebase", "forgejo", "pagure"}
for _, sourceName := range sourceNames {
assert.Contains(t, strings.ToLower(headers), sourceName)
assert.Contains(t, descriptions, locale.Tr(fmt.Sprintf("repo.migrate.%s.description", sourceName)))
assert.Contains(t, descriptions, locale.Tr(fmt.Sprintf("migrate.%s.description", sourceName)))
}
// Special case
assert.Contains(t, strings.ToLower(headers), "pagure")
assert.Contains(t, descriptions, locale.Tr("migrate.pagure.description")) // Not prefixed with repo.
}