Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-30 22:06:11 +01:00
forgejo/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 9b5b714048)
(cherry picked from commit 6c7b5e322d)
2024-02-05 15:08:04 +01:00

28 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
}
"$@"