2017-10-06 08:07:16 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-09-18 20:43:19 +02:00
|
|
|
# See https://zulip.readthedocs.io/en/latest/translating/internationalization.html
|
|
|
|
# for background on this subsystem.
|
|
|
|
|
2017-10-06 08:07:16 +02:00
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2021-03-23 02:01:38 +01:00
|
|
|
./manage.py makemessages --all
|
2021-06-02 18:33:16 +02:00
|
|
|
tx pull -a -f --mode=translator --minimum-perc=5 "$@"
|
2023-01-05 04:12:15 +01:00
|
|
|
# For readability, we prefer UTF-8, not ascii, in these JSON files.
|
|
|
|
find ./locale \
|
|
|
|
-regextype sed \
|
|
|
|
-regex '^\./locale/.*/\(mobile\|translations\).json$' \
|
|
|
|
-exec ./tools/i18n/unescape-contents {} \;
|
|
|
|
|
2023-09-09 02:01:53 +02:00
|
|
|
# Normalize to Unicode Normalization Form C.
|
|
|
|
files="$(find locale -type f -name '*.json' -o -name '*.po')"
|
|
|
|
mapfile -t files <<<"$files"
|
|
|
|
for file in "${files[@]}"; do
|
|
|
|
uconv -x any-nfc "$file" | sponge -- "$file"
|
|
|
|
done
|
|
|
|
|
2024-05-01 13:27:19 +02:00
|
|
|
./tools/i18n/update-for-legacy-translations
|
|
|
|
|
2023-05-03 23:34:32 +02:00
|
|
|
./manage.py compilemessages --ignore='*'
|
2019-09-24 21:57:42 +02:00
|
|
|
./tools/i18n/process-mobile-i18n
|