forked from mougiakouel/QGIS-Training-Manual
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre_translate.sh
executable file
·33 lines (29 loc) · 897 Bytes
/
pre_translate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
LOCALES='af id de ja ro'
# Don't add the code "en" (English) here or bad things will happen!
if [ $1 ]; then
LOCALES=$1
fi
# Create / update the translation catalogue - this will generate the master .pot files
sphinx-build -b gettext . i18n/pot/
# Now iteratively update the locale specific .po files with any new strings needed translation
for LOCALE in ${LOCALES}
do
echo "Updating translation catalog for ${LOCALE}:"
echo "------------------------------------"
mkdir -p i18n/${LOCALE}/LC_MESSAGES
cp -r _static_en _static_${LOCALE}
for FILE in `ls i18n/pot`
do
POTFILE=i18n/pot/${FILE}
POFILE=i18n/${LOCALE}/LC_MESSAGES/`basename ${POTFILE} .pot`.po
if [ -f $POFILE ];
then
echo "Updating strings for ${POFILE}"
msgmerge -U ${POFILE} ${POTFILE}
else
echo "Creating ${POFILE}"
cp ${POTFILE} ${POFILE}
fi
done
done