feat(build): lint-locale-usage should handle dynamically generated msgids with known prefix

This commit is contained in:
Ellen Emilia Anna Zscheile 2025-08-03 23:53:46 +02:00
commit 560eb35a85
3 changed files with 93 additions and 7 deletions

View file

@ -161,6 +161,15 @@ func ParseAllowedMaskedUsages(fname string, usedMsgids *container.Set[string], a
return nil
}
// Truncating a message id prefix to the last dot
func PrepareMsgidPrefix(s string) (string, bool) {
index := strings.LastIndexByte(s, 0x2e)
if index == -1 {
return "", true
}
return s[:index], index != len(s)-1
}
// This command assumes that we get started from the project root directory
//
// Possible command line flags: