From 5aa80302af2aa31b63c51f5e020b8464ab635ff2 Mon Sep 17 00:00:00 2001 From: nytpu Date: Tue, 11 May 2021 11:19:37 -0600 Subject: [PATCH] add localization generation and add to build system --- .gitignore | 1 + .goreleaser.yml | 1 + Makefile | 2 ++ comitium.go | 3 +++ 4 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 2912d62..7a50349 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /dist/ /build/ +/localizations/ diff --git a/.goreleaser.yml b/.goreleaser.yml index 10581aa..8207933 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,6 @@ before: hooks: + - go generate ./... - scdoc < doc/comitium.1.scd > dist/comitum.1 - mv dist/comitium.1 /home/alex/projects/gemini.nytpu.com/releases/comitium/{{ .Version }} builds: diff --git a/Makefile b/Makefile index 2eb2cd5..bf4b844 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ $(BUILDDIR): $(BUILDDIR)/$(NAME): $(GOSRC) | $(BUILDDIR) + $(GO) generate ./... $(GO) build $(GOFLAGS) -ldflags "$(GOLDFLAGS)" -o $@ @@ -55,6 +56,7 @@ $(BUILDDIR)/%.1: doc/%.1.scd | $(BUILDDIR) clean: -$(RM) -r $(BUILDDIR) + -$(RM) -r localizations install: all diff --git a/comitium.go b/comitium.go index 6ab845f..5756098 100644 --- a/comitium.go +++ b/comitium.go @@ -6,6 +6,9 @@ // doc/comitium.1.scd for a manual page. package main +// generate the translations: +//go:generate go-localize -input localizations_src -output localizations + import ( "fmt" "net/url"