feat(i18n): Check for new translatable strings on every PR

We've only been updating translatable strings for Weblate rarely based on
MAINTAINING.md#translations-from-weblate. Since Weblate pulls in commits live
from qTox, we should generate the translatable strings as soon as they're
introduced so that translators can not waste time translating deleted strings,
and can spend time translating new strings.

We can't auto-commit the changes in CI due to our requirement of signed
commits, so just fail CI if any new strings are found.

Move it into its own job, it doesn't depend on docker or the build, and doesn't need to run for debug/release/full/minimal
reviewable/pr6482/r3
Anthony Bilinski 2022-02-18 12:44:20 -08:00
parent 5f8704cf0f
commit 11450afa81
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
3 changed files with 13 additions and 9 deletions

View File

@ -172,6 +172,15 @@ jobs:
docker_image_name: debian_old
- name: Run build
run: docker-compose run --rm debian_old ./.ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }}
translation-check:
name: Check for translatable strings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install deps
run: sudo apt-get update && sudo apt-get install qttools5-dev
- name: Test for modified translatable strings
run: ./tools/update-translation-files.sh ALL && git diff --exit-code
build-ubuntu:
name: Ubuntu LTS
runs-on: ubuntu-latest

View File

@ -161,6 +161,9 @@ require a bit more attention & regular checking whether there are new
translations, on the other, it lessened problems that were happening with
"manual" way of providing translations.
New translable strings need to be generated into a form Weblate can consume
using `./tools/update-translation-files.sh ALL` and commiting the result.
To get translations into qTox:
1. Go to `https://hosted.weblate.org/projects/tox/qtox/#repository` and lock
@ -174,11 +177,7 @@ To get translations into qTox:
- `translations/README.md`
- `translations/i18n.pri`
- `translations/translations.qrc`
5. To update translatable strings from qTox for Weblate, run
`./tools/update-translation-files.sh ALL`
6. Checkout a new branch with e.g. `git checkout -b update_weblate` and open
a Pull Request for it on Github.
7. After the Pull Request has been merged, `reset` Weblate to master and
5. After the Pull Request has been merged, `reset` Weblate to master and
unlock it.
# Releases

View File

@ -27,7 +27,6 @@
set -eu -o pipefail
readonly COMMIT_MSG="chore(i18n): update translation files for Weblate"
readonly LUPDATE_CMD="lupdate src -no-obsolete -locations none -ts"
if [[ "$@" = "ALL" ]]
@ -36,9 +35,6 @@ then
do
$LUPDATE_CMD "$translation"
done
git add translations/*.ts
git commit -m "$COMMIT_MSG"
else
$LUPDATE_CMD "$@"
fi