forked from achilleas-k/gnome15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-po.sh
executable file
·41 lines (36 loc) · 965 Bytes
/
build-po.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
34
35
36
37
38
39
40
41
#!/bin/bash
echo -e "Locale: \c"
read locale
if [ -n "${locale}" ]; then
cd $(dirname $0)
basedir=$(pwd)
for i in src/*; do
if [ -d ${i} ]; then
modname=$(basename $i)
echo $modname
pushd ${i} >/dev/null
mkdir -p i18n
# Generate python / ui
pushd i18n >/dev/null
for i in *.pot; do
bn=$(basename $i .pot).${locale}.po
msginit --no-translator --input=${i} --output=${bn} --locale=${locale}
done
popd >/dev/null
# Generate theme
for j in *
do
if [ -d $j/i18n ]; then
pushd $j/i18n >/dev/null
for k in *.pot ; do
bn=$(basename $k .pot).${locale}.po
echo "$k -> $bn [$locale]"
msginit --no-translator --input=${k} --output=${bn} --locale=${locale}
done
popd >/dev/null
fi
done
popd >/dev/null
fi
done
fi