From ce77a67354eb3de9ca4778d2d817c0e06c14166b Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 30 Jul 2025 09:41:31 +0200 Subject: [PATCH] Add explicit language list to update_messages.sh --- docs/translating.md | 5 ++--- tools/update_messages.sh | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/translating.md b/docs/translating.md index e5de1c80..0aee035d 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -7,10 +7,9 @@ You only need `gettext` and a text editor, you can optionally use a graphical ed # Adding a new language -* Edit the `tools/update_messages.sh`, adding the 2 letter [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code to the `LANGS` variable. +* Run `tools/update_messages.sh LANG` where LANG is the 2 letter [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code, this will create files in the `locale` directory for the new language. Fill in the fields, `git add` the files, commit and file a pull request. * (optional) Edit the `tools/check_po.py`, add to the `countries` mapping a value with the language code on the left and the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) code of a flag on the right. The flag will only be used for continuous integration messages. -* Run the `tools/update_messages.sh` script, this will create files in the `locale` directory for the new language. Fill in the fields, `git add` the files, commit and file a pull request. # Editing existing translations -Run the `tools/update_messages.sh` script, this will add the lines for the missing translations, edit your language, then `git add` the files for the language you just edited, commit and file a pull request. +Run the `tools/update_messages.sh [lang...]` script with the list of languages you wish to edit, this will add the lines for the missing translations, edit them, then `git add` the files for the language you just edited, commit and file a pull request. diff --git a/tools/update_messages.sh b/tools/update_messages.sh index ed6bb663..de013aeb 100755 --- a/tools/update_messages.sh +++ b/tools/update_messages.sh @@ -27,7 +27,11 @@ xgettext \ sed -i 's/charset=CHARSET/charset=UTF-8/g' $WIVRN_CLIENT_POT $WIVRN_DASHBOARD_POT -LANGS="es fr it ja zh_TW pt_BR" +if [ "$#" -ge 1 ] ; then + LANGS="$@" +else + LANGS="$(ls -1 locale)" +fi for i in $LANGS do