From 1d9f95687b395df973e19d97294fca16b6f233e6 Mon Sep 17 00:00:00 2001 From: fnetx Date: Wed, 14 Dec 2022 19:56:57 +0100 Subject: [PATCH] [I18N] Makefile + gitignore (cherry picked from commit 68c744111d02a0cd93716a8f75442ad85f44243b) (cherry picked from commit 30d7c4a8998baf957b8a156789cc6601d4e87628) (cherry picked from commit 220ac0a6d3579da5d9c1a028cdd59511f3e97a88) (cherry picked from commit 21cb16af9502c0c14aae30eee3a65d4c14be3cbe) (cherry picked from commit 41a9373e3e78f050bb07ea475fdbf3261cf694b2) (cherry picked from commit 69030f7803c175706946af5fb8956d19aa7d2bec) (cherry picked from commit 92c4d4d2e6bf7f100feb5c85a9ae78afea2adbd8) (cherry picked from commit c1bfd1730e79c6c1720df99f367ddc030282f7e3) (cherry picked from commit 18a9a9e73cdea5bd501b10a2fde0d39be74d7f25) (cherry picked from commit 07f988207303011b3f645dc515ff855c0317507f) (cherry picked from commit e71b8061d4297fe2336cbf404046c1fdd8332fc6) (cherry picked from commit 225b30f1f77cd5edd06ca4a271a64029b0391d7e) (cherry picked from commit fdf98910039a98009e3c38be00db1785fe4292e7) (cherry picked from commit df2f4134764a4811a4f012193b93b2d1b8a2749b) (cherry picked from commit b01c755aaf634dd0f4c436ad90eda47f6e901afd) (cherry picked from commit acd4275acbada93b49c0baabfc5bd9db2ebbca6c) [I18N] Add Locale merger script (squash: compile on windows) Fixes: https://codeberg.org/forgejo/forgejo/issues/798 (cherry picked from commit b47b205e85f115b2493bd4c3a25c199196228d7a) (cherry picked from commit 1521f0bfd6747d0ad0d9c5e70c4c0b1d948e178e) (cherry picked from commit 7f988de42c6934105399985c7dd652ce81b79b3f) (cherry picked from commit d26b4913129e13c3afde69cd6c6db948e7789e3e) (cherry picked from commit 60136bac666f588179dbe1a9d98df0f82fcfb7de) (cherry picked from commit 915bb4b3542b14cc5f0e4d9feb3b8fa55a6d8440) (cherry picked from commit 3e1b42a8ca84a6abb81d4dfaf84ea7be383e7a37) (cherry picked from commit 18d8fc075fa6002fc1af0374005801cdeffc185d) --- .gitignore | 3 +++ Makefile | 14 ++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 362ef556ed..7c8969f6a5 100644 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,6 @@ prime/ # Manpage /man + +# Generated merged Forgejo+Gitea language files +/options/locale/locale_* diff --git a/Makefile b/Makefile index 7a9ebbf2fa..47e71c8704 100644 --- a/Makefile +++ b/Makefile @@ -828,10 +828,14 @@ generate: generate-backend generate-backend: $(TAGS_PREREQ) generate-go .PHONY: generate-go -generate-go: $(TAGS_PREREQ) +generate-go: $(TAGS_PREREQ) merge-locales @echo "Running go generate..." @CC= GOOS= GOARCH= $(GO) generate -tags '$(TAGS)' $(GO_PACKAGES) +.PHONY: merge-locales +merge-locales: + @CC= GOOS= GOARCH= $(GO) run build/merge-forgejo-locales.go + .PHONY: security-check security-check: go run $(GOVULNCHECK_PACKAGE) ./... @@ -1001,13 +1005,7 @@ lockfile-check: .PHONY: update-translations update-translations: - mkdir -p ./translations - cd ./translations && curl -L https://crowdin.com/download/project/gitea.zip > gitea.zip && unzip gitea.zip - rm ./translations/gitea.zip - $(SED_INPLACE) -e 's/="/=/g' -e 's/"$$//g' ./translations/*.ini - $(SED_INPLACE) -e 's/\\"/"/g' ./translations/*.ini - mv ./translations/*.ini ./options/locale/ - rmdir ./translations + # noop to detect merge conflicts (potentially needs updating the scripts) and avoid breaking with Gitea .PHONY: generate-license generate-license: