fix(build): actually enforce masked prefixes verification in lint-locale-usage

This commit is contained in:
Ellen Emilia Anna Zscheile 2025-08-04 00:30:11 +02:00
commit f2bb2016e1
3 changed files with 52 additions and 4 deletions

View file

@ -43,7 +43,11 @@ func (handler Handler) handleGoTrArgument(fset *token.FileSet, n ast.Expr) {
arg, err := strconv.Unquote(argLit.Value)
if err == nil {
// found interesting strings
handler.OnMsgidPrefix(fset, argLit.ValuePos, arg)
prep, trunc := PrepareMsgidPrefix(arg)
if trunc {
handler.OnWarning(fset, argLit.ValuePos, fmt.Sprintf("needed to truncate message id prefix: %s", arg))
}
handler.OnMsgidPrefix(fset, argLit.ValuePos, prep)
}
}
}