gotext icon indicating copy to clipboard operation
gotext copied to clipboard

feat: `--keyword` / `--keyword-plural` for `xgotext`

Open decentral1se opened this issue 4 months ago • 1 comments

In xgettext-go you have several additional flags like this invocation (pulled from the incus project):

xgettext-go -o po/$(DOMAIN).pot --add-comments-tag=TRANSLATORS: --sort-output --package-name=$(DOMAIN) [email protected] --keyword=i18n.G --keyword-plural=i18n.NG cmd/incus/*.go shared/cliconfig/*.go

I'd like to add the --keyword=... / --keyword-plural=... to xgotext which I personally need for a project.

Just creating this in case there are objections, PR incoming when I get time.

decentral1se avatar Aug 21 '25 17:08 decentral1se

@leonelquinteros would you be able to explain the significance of the the int values in this part? It seems like I just need to inject my --keyword params into this map at some point 🤔

https://github.com/leonelquinteros/gotext/blob/270f280ba5443979a5ddfc6010d874f19b558d1b/cli/xgotext/parser/gofile.go#L28-L38

decentral1se avatar Aug 21 '25 18:08 decentral1se