mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-26 12:13:57 +00:00
feat(build): lint-locale-usage should handle dynamically generated msgids with known prefix
This commit is contained in:
parent
c7349ed42d
commit
560eb35a85
3 changed files with 93 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue