feat: msgctxt support

See toolshed/abra#647
See toolshed/xgettext-go#1
This commit is contained in:
2025-09-30 19:07:31 +02:00
parent 0db1ee87fc
commit 033c9bfc13
14 changed files with 125 additions and 28 deletions

View File

@ -78,14 +78,20 @@ update-po:
done
.PHONY: update-pot
update-pot:
@xgettext-go \
update-pot: ./bin/xgettext-go
@./bin/xgettext-go \
-o pkg/i18n/locales/$(DOMAIN).pot \
--keyword=i18n.G \
--keyword-ctx=i18n.GC \
--sort-output \
--add-comments-tag="translators" \
$$(find . -name "*.go" -not -path "*vendor*" | sort)
./bin/xgettext-go:
@mkdir -p ./bin && \
wget -O ./bin/xgettext-go https://git.coopcloud.tech/toolshed/xgettext-go/raw/branch/main/xgettext-go && \
chmod +x ./bin/xgettext-go
.PHONY: update-pot-po-metadata
update-pot-po-metadata:
@sed -i "s/charset=CHARSET/charset=UTF-8/g" pkg/i18n/locales/*.po pkg/i18n/locales/*.pot