From f3eccc966da6ab2cb9ab8e915613f992a25817da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 27 Jan 2025 11:47:34 +0100 Subject: [PATCH] fix l10n tooling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .bingo/Variables.mk | 6 ++++++ .bingo/go-xgettext.mod | 7 +++++++ .bingo/go-xgettext.sum | 6 ++++++ .bingo/variables.env | 2 ++ .gitignore | 3 ++- services/activitylog/Makefile | 2 +- services/graph/Makefile | 2 +- services/notifications/Makefile | 2 +- services/settings/Makefile | 2 +- services/userlog/Makefile | 2 +- 10 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 .bingo/go-xgettext.mod create mode 100644 .bingo/go-xgettext.sum diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index bb98a7f886..948344d87a 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -47,6 +47,12 @@ $(GO_LICENSES): $(BINGO_DIR)/go-licenses.mod @echo "(re)installing $(GOBIN)/go-licenses-v1.5.0" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=go-licenses.mod -o=$(GOBIN)/go-licenses-v1.5.0 "github.com/google/go-licenses" +GO_XGETTEXT := $(GOBIN)/go-xgettext-v0.0.0-20160830220431-74466a0a0c4a +$(GO_XGETTEXT): $(BINGO_DIR)/go-xgettext.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/go-xgettext-v0.0.0-20160830220431-74466a0a0c4a" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=go-xgettext.mod -o=$(GOBIN)/go-xgettext-v0.0.0-20160830220431-74466a0a0c4a "github.com/gosexy/gettext/go-xgettext" + GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.56.2 $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. diff --git a/.bingo/go-xgettext.mod b/.bingo/go-xgettext.mod new file mode 100644 index 0000000000..b14946a0b8 --- /dev/null +++ b/.bingo/go-xgettext.mod @@ -0,0 +1,7 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.23.4 + +require github.com/gosexy/gettext v0.0.0-20160830220431-74466a0a0c4a // go-xgettext + +require github.com/jessevdk/go-flags v1.6.1 // indirect diff --git a/.bingo/go-xgettext.sum b/.bingo/go-xgettext.sum new file mode 100644 index 0000000000..9d38863599 --- /dev/null +++ b/.bingo/go-xgettext.sum @@ -0,0 +1,6 @@ +github.com/gosexy/gettext v0.0.0-20160830220431-74466a0a0c4a h1:N2b2mb4Gki1SlF3WuhR9P1YHOpl7oy/b+xxX4A3iM2E= +github.com/gosexy/gettext v0.0.0-20160830220431-74466a0a0c4a/go.mod h1:IEJaV4/6J0VpoQ33kFCUUP6umRjrcBVEbOva6XCub/Q= +github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4= +github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= diff --git a/.bingo/variables.env b/.bingo/variables.env index 4523d0f890..94e6a39bf4 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -18,6 +18,8 @@ CALENS="${GOBIN}/calens-v0.4.0" GO_LICENSES="${GOBIN}/go-licenses-v1.5.0" +GO_XGETTEXT="${GOBIN}/go-xgettext-v0.0.0-20160830220431-74466a0a0c4a" + GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.56.2" GOVULNCHECK="${GOBIN}/govulncheck-v1.0.1" diff --git a/.gitignore b/.gitignore index 7e94f1498f..93b034fd6b 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,8 @@ tests/qa-activity-report/reports/ # drone CI is in .drone.star, do not let someone accidentally commit a local .drone.yml .drone.yml -**/l10n/template.pot +# ignore temporary l10n template files +**/l10n/*.pot # protogen autogenerated protogen/buf.sha1.lock diff --git a/services/activitylog/Makefile b/services/activitylog/Makefile index f57e85e66f..6043c63934 100644 --- a/services/activitylog/Makefile +++ b/services/activitylog/Makefile @@ -44,7 +44,7 @@ l10n-push: .PHONY: l10n-read l10n-read: $(GO_XGETTEXT) - go-xgettext -o $(OUTPUT_DIR)/activitylog.pot --keyword=l10n.Template -s pkg/service/response.go + $(GO_XGETTEXT) -o $(OUTPUT_DIR)/activitylog.pot --keyword=l10n.Template -s pkg/service/response.go .PHONY: l10n-write l10n-write: diff --git a/services/graph/Makefile b/services/graph/Makefile index 7f78ab9e51..4295c26d53 100644 --- a/services/graph/Makefile +++ b/services/graph/Makefile @@ -45,7 +45,7 @@ l10n-push: .PHONY: l10n-read l10n-read: $(GO_XGETTEXT) - go-xgettext -o $(OUTPUT_DIR)/graph.pot --keyword=l10n.Template --add-comments -s pkg/service/v0/spacetemplates.go -s pkg/unifiedrole/roles.go + $(GO_XGETTEXT) -o $(OUTPUT_DIR)/graph.pot --keyword=l10n.Template --add-comments -s pkg/service/v0/spacetemplates.go -s pkg/unifiedrole/roles.go .PHONY: l10n-write l10n-write: diff --git a/services/notifications/Makefile b/services/notifications/Makefile index 08f9b2820a..098294abe2 100644 --- a/services/notifications/Makefile +++ b/services/notifications/Makefile @@ -44,7 +44,7 @@ l10n-push: .PHONY: l10n-read l10n-read: $(GO_XGETTEXT) - go-xgettext -o $(OUTPUT_DIR)/notifications.pot --keyword=l10n.Template --add-comments -s pkg/email/templates.go + $(GO_XGETTEXT) -o $(OUTPUT_DIR)/notifications.pot --keyword=l10n.Template --add-comments -s pkg/email/templates.go .PHONY: l10n-write l10n-write: diff --git a/services/settings/Makefile b/services/settings/Makefile index 116ee5ad6b..ef1fd71e51 100644 --- a/services/settings/Makefile +++ b/services/settings/Makefile @@ -61,7 +61,7 @@ l10n-push: .PHONY: l10n-read l10n-read: $(GO_XGETTEXT) - go-xgettext -o $(OUTPUT_DIR)/settings.pot \ + $(GO_XGETTEXT) -o $(OUTPUT_DIR)/settings.pot \ --keyword=l10n.Template --add-comments -s \ pkg/store/defaults/templates.go diff --git a/services/userlog/Makefile b/services/userlog/Makefile index 4be42ab76b..5d7f66ee47 100644 --- a/services/userlog/Makefile +++ b/services/userlog/Makefile @@ -44,7 +44,7 @@ l10n-push: .PHONY: l10n-read l10n-read: $(GO_XGETTEXT) - go-xgettext -o $(OUTPUT_DIR)/userlog.pot --keyword=l10n.Template -s pkg/service/templates.go + $(GO_XGETTEXT) -o $(OUTPUT_DIR)/userlog.pot --keyword=l10n.Template -s pkg/service/templates.go .PHONY: l10n-write l10n-write: