blob: 8e6bb539c3e9bbc20b10da436be9547a8ea563d7 (
plain)
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
|
#!/bin/bash -e
LANG=$1
for doci in en/*.xml; do
docfilename=${doci#*/}
doc=${docfilename%.*}
if [[ $LANG == "" ]]; then
for i in *.po
do
ILANG=${i%.*}
echo "Producing XML "$doc" for locale "$ILANG
po4a-translate -k 0 --format docbook --master-charset utf-8 --localized-charset utf-8 \
-o doctype="book" -o nodefault="<imageobject> <caution> <note>" -o untranslated="<imageobject>" -o translated="<caution> <note>" --master en/${doc}.xml \
--po $ILANG.po --localized $ILANG/${doc}.xml
perl -i -p -e "s/version=\"5\.0\"/version=\"5\.0\" xml:lang=\"$ILANG\"/;" $ILANG/${doc}.xml
perl -i -p -e "s/xml\:lang=\"$ILANG\"\ xml\:lang=\"$ILANG\"/xml\:lang=\"$ILANG\"/;" $ILANG/${doc}.xml
done
else
echo "Producing XML of "$doc" for locale "$LANG
po4a-translate -k 0 --format docbook --master-charset utf-8 --localized-charset utf-8 \
-o doctype="book" -o nodefault="<imageobject> <caution> <note>" -o untranslated="<imageobject>" -o translated="<caution> <note>" --master en/${doc}.xml \
--po $LANG.po --localized $LANG/${doc}.xml
perl -i -p -e "s/version=\"5\.0\"/version=\"5\.0\" xml:lang=\"$LANG\"/;" $LANG/${doc}.xml
perl -i -p -e "s/xml\:lang=\"$LANG\"\ xml\:lang=\"$LANG\"/xml\:lang=\"$LANG\"/;" $LANG/${doc}.xml
fi
done
|