Skip to content

[CI] weblate.push.translations does not sync new languages #4117

Open
@return42

Description

SearXNG’s PR workflow to be in sync with Weblate [1] is not able to sync a newly added language / and I assume its the same when removing an unmaintained language.

Here is what I expected:

To add a new language e.g tt (Tatar):

  $ ./manage pyenv.cmd bash
  $ pybabel init -i searx/translations/messages.pot -d searx/translations -l tt
  creating catalog searx/translations/tt/LC_MESSAGES/messages.po based on searx/translations/messages.pot

  $ ./searxng_extra/update/update_locales.py

Create a PR [2] and merge the PR .. Then the CI starts weblate.push.translations

make V=1 weblate.push.translations

but this command just monitors modification off the messages.pot file

# stop if there is no meaningful change in the master branch
diff_messages_pot=$(cd "${TRANSLATIONS_WORKTREE}";\
git diff -- "searx/translations/messages.pot")
if ! echo "$diff_messages_pot" | grep -qE "[\+\-](msgid|msgstr)"; then
build_msg BABEL 'no changes detected, exiting'
return 42
fi

Here is what I tried first to sync:

Since a new language does not modify the message.pot the commands stops here without syncing the new language to weblate.

Then I tried to trigger by adding a dummy string in 899edee .. and the CI (weblate.push.translations) synced the modification of the messages.pot file to the translation branch in f75ddb0 .. but did not synced the new language (tt).

[1] https://docs.searxng.org/dev/translation.html#searxng-weblate-workflow
[2] #4106


My final workaround

To add new language the following steps are needed:

  1. create and merge a PR for the new language (as described above)
  2. manually commit the folder of the new language to the translations branch (like I added tt in 67abcc1)
  3. To trigger CI (weblate.push.translations) a modification of the messages.pot file is needed / I just reverted 899edee from above in 1604a00

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions