From cd86ad60e688726139dd496ffb66048848a840e0 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) (cherry picked from commit 1d9f95687b395df973e19d97294fca16b6f233e6) (cherry picked from commit e49da1a90d2358f18510d8e2e45448b24386f34e) (cherry picked from commit a182baed8a6a139dc473aa74797cdc404c206a72) (cherry picked from commit 3e48a87c0044b38dc8a9594c0dd14921a40f7e0b) (cherry picked from commit e0bb406c146408739f3140182082e910ac5b874c) (cherry picked from commit e45ec160f95f35a156423f98d7e8b0479184e197) (cherry picked from commit e89ec6d0086aedd0fddc2ee282b7a0f2c87b917a) (cherry picked from commit 80eb392c5c2c6e6decb7f99873c3dc7d6b300dd6) (cherry picked from commit d0bce1b613ab2c72c960f1e982b5cf7d60a7dfb2) (cherry picked from commit 8debcf86ea78cfb0e93eb720fb57f18641f1f65f) (cherry picked from commit a9bc3c54d721dbec8df640ba80f85cf0bfd5b36a) (cherry picked from commit d5595e4156cb7a613c1ff3cf28bfbfefa6678fd0) (cherry picked from commit 25cef0fad366af2faf5687fa95d445b43d28215d) (cherry picked from commit e4d15446ff34b2e9b624f3a8c6bdb9930e1b9b37) (cherry picked from commit 77ceb2a795bce2797f819960103b59f22e9bba4d) (cherry picked from commit 61ebe5c5365fb6df6cfcfd4f24e6309e6fa39707) (cherry picked from commit 9377e1d1f25f773123abdf1b1665b765b2c503dd) (cherry picked from commit 7a90ba2922d9250adcbebffaf26d773805895e64) (cherry picked from commit bc65d42a836c16936e8327d47e8d20edd5d1ca3d) (cherry picked from commit 333f486015c8a05389c4aa70a23225f3719e5d43) (cherry picked from commit 0e90edaf12a2fc1241fb02cf398a0c8d316f6d7b) (cherry picked from commit 511d797ffbd4ef505d243bbb1c2cfba0d39a8b3f) (cherry picked from commit 2515b655ab6c7aa9fbb7a37023b1c77774e4a88e) --- .gitignore | 3 +++ Makefile | 14 ++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 12014d405b..4ec16917d6 100644 --- a/.gitignore +++ b/.gitignore @@ -118,3 +118,6 @@ prime/ # Manpage /man + +# Generated merged Forgejo+Gitea language files +/options/locale/locale_* diff --git a/Makefile b/Makefile index d9582737ec..a504cbf648 100644 --- a/Makefile +++ b/Makefile @@ -796,10 +796,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) ./... @@ -972,13 +976,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: