Skip to content

Commit 455763e

Browse files
tobiasmcnultySaptakS
authored andcommitted
Updated instructions
1 parent 567e690 commit 455763e

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

README.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -322,28 +322,25 @@ Updating translations from Transifex
322322
Anytime translations on Transifex have been updated, someone should update
323323
our translation files as follows:
324324

325-
1. Review the translations in Transifex and add to the space-delimited
326-
``LANGUAGES`` list in ``update-translations.sh``, any new languages that have
327-
reached 100% translation.
328-
329-
2. Pull the updated translation files::
325+
1. Pull the updated translation files::
330326

331327
./update-translations.sh
332328

333-
3. Use ``git diff`` to see if any translations have actually changed. If not,
329+
2. Use ``git diff`` to see if any translations have actually changed. If not,
334330
you can just revert the .po file changes and stop here.
335331

336-
4. Compile the messages::
332+
3. Compile the messages::
337333

338334
python -m manage compilemessages
339335

340-
5. Run the test suite one more time::
336+
4. Run the test suite one more time::
341337

342338
python -m manage test
343339

344-
6. Commit and push the changes to GitHub::
340+
5. Commit and push the changes to GitHub::
345341

346-
git commit -m "Updated translations" locale/*/LC_MESSAGES/*
342+
git add dashboard/locale/ docs/locale/ locale/
343+
git commit -m "Updated translations"
347344
git push
348345

349346
Running Locally with Docker

update-translations.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
#!/bin/sh
22

3-
# Update translations from Transifex for the supported languages, and remove
4-
# the source location references (to help keep the diff noise down). Adapted from:
3+
# Script to update translations and remove the source location references (to help keep the
4+
# diff noise down). Adapted from:
55
# https://github.com/django/django-docs-translations/blob/stable/2.1.x/manage_translations.py
66

77
set -ex
88

9-
LANGUAGES="el es fr id it ja ko pl pt_BR zh_Hans"
10-
119
LOCALE_DIRS="dashboard/locale/ docs/locale/ locale/"
1210

13-
for LANG in $LANGUAGES; do
14-
tx pull -f -l $LANG --minimum-perc=70
15-
for DIR in $LOCALE_DIRS; do
16-
PO_FILE="$DIR$LANG/LC_MESSAGES/django.po"
17-
if [ -f "$PO_FILE" ]; then
18-
msgcat --no-location -o $PO_FILE $PO_FILE
19-
fi
11+
tx pull -a -f --minimum-perc=70
12+
13+
for DIR in $LOCALE_DIRS; do
14+
for PO_FILE in $(find $DIR -name django.po -not -path en/); do
15+
msgcat --no-location -o $PO_FILE $PO_FILE
2016
done
2117
done

0 commit comments

Comments
 (0)