Create a CI job to check strings.po files

This commit is contained in:
Thomas Bétous 2021-04-26 22:55:40 +02:00
parent 13186dc697
commit 6a8177ca25
2 changed files with 32 additions and 1 deletions

View File

@ -45,6 +45,22 @@ quality:
expire_in: 1 week
when: always
# Translation job: check that all the string.po files use the same strings as
# the reference file
translation:
stage: validation
# Do not get any artifacts from previous jobs
dependencies: []
rules:
# Run this job only on merge requests containing changes on strings.po
# files and only as "manual"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
changes:
- resources/language/*/strings.po
when: manual
script:
- files=$(find . -name strings.po -not -path './resources/language/resource.language.en_gb/*') && for file in files; do msgcmp $file ./resources/language/resource.language.en_gb/strings.po; done
# Pre-release job: will be available in all the merge requests with release
# branches in order to verify the release can be actually created. The
# verification is done by running the release script in dry run mode.

View File

@ -59,7 +59,7 @@ It contains 2 classes:
received from `addon.py`
* PeertubeDownloader: downloads torrent in an independent thread
This module must be as short as possible (15 effective lines of code maximum)
This module should be as short as possible (15 effective lines of code maximum)
to comply with Kodi add-on development best practices (checked by the
[Kodi add-on checker](https://github.com/xbmc/addon-check)).
@ -141,3 +141,18 @@ These steps should be followed only by maintainers.
4. A new pipeline with the job `create-release` will be created: run the job
manually since it should be `blocked` (maintainers only)
5. The new release will be available on the releases page.
## Translation
To translate the add-on you may:
* edit one of the `strings.po` file existing in the subfolders of
`resources/language`
* create a new `strings.po` for your language
A CI job called `translation` is available in each merge request which contains
changes in strings.po files. It checks that the reference strings in the
translation files are the same as in the reference file
([resources/language/resource.language.en_gb/strings.po](./resources/language/resource.language.en_gb/strings.po)).
More information on the translation system used by Kodi and its add-on is
available [here](https://kodi.wiki/view/Language_support).