feat(build): lint-locale-usage should detect more Tr functions (#7278)
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped

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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7278
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
This commit is contained in:
Ellen Emilia Anna Zscheile 2025-03-26 14:06:44 +00:00 committed by Gusted
parent e84d3a0f53
commit d0a5531ebc
3 changed files with 121 additions and 62 deletions

View file

@ -27,6 +27,10 @@ type contextKey struct{}
var ContextKey any = &contextKey{}
// Locale represents an interface to translation
//
// If this gets modified, remember to also adjust
// build/lint-locale-usage/lint-locale-usage.go's InitLocaleTrFunctions(),
// which requires to know in what argument positions `trKey`'s are given.
type Locale interface {
Language() string
TrString(string, ...any) string