diff --git a/.drone.yml b/.drone.yml index d5d9809d..e8158701 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,6 +7,23 @@ steps: commands: - make check + - name: xgettext-go + image: git.coopcloud.tech/toolshed/drone-xgettext-go:latest + settings: + keyword: i18n.G + out: pkg/i18n/locales/abra.pot + depends_on: + - make check + + - name: xgettext-go status + image: golang:1.24-alpine3.22 + commands: + - apk add patchutils git make + - cd /drone/src + - make update-pot-po-metadata check-pot-changes + depends_on: + - xgettext-go + - name: make test image: golang:1.24 environment: diff --git a/Makefile b/Makefile index f7051d70..7f5064c7 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,15 @@ update-pot: .PHONY: update-pot-po-metadata update-pot-po-metadata: - @sed -i "s/charset=CHARSET/charset=UTF-8/g" pkg/i18n/locales/*.po* + @sed -i "s/charset=CHARSET/charset=UTF-8/g" pkg/i18n/locales/*.po pkg/i18n/locales/*.pot* + +.PHONY: check-pot-changes +check-pot-changes: + @git diff pkg/i18n/locales/abra.pot | grepdiff --output-matching=hunk POT-Creation-Date | git apply --reverse --allow-empty + @if ! git diff-files --quiet; then \ + git diff pkg/i18n/locales/abra.pot; \ + exit 1; \ + fi .PHONY: build-mo build-mo: diff --git a/cli/app/labels.go b/cli/app/labels.go index 43017377..e59dcea6 100644 --- a/cli/app/labels.go +++ b/cli/app/labels.go @@ -24,7 +24,7 @@ var AppLabelsCommand = &cobra.Command{ Aliases: []string{i18n.G("lb")}, Short: i18n.G("Show deployment labels"), Long: i18n.G("Both local recipe and live deployment labels are shown."), - Example: i18n.G(" abra app labels 1312.net"), + Example: " " + i18n.G("abra app labels 1312.net"), Args: cobra.ExactArgs(1), ValidArgsFunction: func( cmd *cobra.Command,