forgejo-federation/build/crowdin-to-weblate.sh
Earl Warren cb8c9d5bcf
[I18n] tooling and process
Before:

* Translations were imported from Crowdin via Gitea
* New strings were added by Forgejo in feature branches but never translated
* The build/merge-forgejo-locales.go script in the forgejo-i18n branch
  added/replaced Forgejo specific strings in the translated files at
  build time
* Conflicts arising from Gitea changes in locale_en-US.ini were resolved by moving around
  Forgejo strings

Transition:

* The build/merge-forgejo-locales.go is run once on the source
* The result is commited to the forgejo-development branch

After:

* Translation are exported and imported from translate.codeberg.org
* build/crowdin-to-weblate.sh run is run when rebasing (soft-fork)
  or cherry-picking (hard-fork) to collect new translations from
  Crowdin via Gitea
* In case of a conflict Forgejo translations are authoritative
* In the absence of a conflict Crowdin translations are uploaded to Weblate

(cherry picked from commit 9b5b7140480a75edb070d4151f585c20d3a08f64)
(cherry picked from commit 6c7b5e322d1dc736f2e2d9725f77f09bbdb5ffa1)
2024-02-05 15:08:04 +01:00

27 lines
494 B
Bash
Executable file

#!/bin/bash
# Copyright 2024 The Forgejo Authors
# SPDX-License-Identifier: MIT
D=/tmp/crowdin-to-weblate
mkdir -p $D
function checkout() {
if test -d $D/gitea ; then
git -C $D/gitea reset --hard
return
fi
git clone --depth 1 https://github.com/go-gitea/gitea $D/gitea
}
function replace() {
go run build/merge-forgejo-locales.go $D/gitea/options/locale
cp -a $D/gitea/options/locale/* options/locale
}
function run() {
checkout
replace
}
"$@"