This repository has been archived by the owner on Feb 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-pot.sh
executable file
·54 lines (47 loc) · 1.55 KB
/
build-pot.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
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#
# Creates the initial i18n structure for plugins
#
cd $(dirname $0)
basedir=$(pwd)
for i in src/*; do
if [ -d ${i} ]; then
modname=$(basename $i)
pushd ${i}
mkdir -p i18n
# Python
xgettext --language=Python --keyword=_ --output=i18n/${modname}.pot *.py
# Theme files
for m in *; do
if [ -d "$m" ]; then
pushd $m
if [ $(ls *.svg 2>/dev/null|wc -l) -gt 0 ]; then
mkdir -p i18n
echo "Found SVG"
for s in *.svg; do
echo "Generating C header$s"
svgname=$(basename ${s} .svg)
${basedir}/../gnome15/mksvgheaders.py ${s} > i18n/${svgname}.h
if [ -s i18n/${svgname}.h ]; then
echo "Generating POT for ${svgname}.h"
xgettext --language=Python --keyword=_ --keyword=N_ --output=i18n/${svgname}.pot i18n/${svgname}.h
else
rm -f i18n/${svgname}.h
fi
done
fi
popd
fi
done
# .ui files
if [ $(ls *.ui 2>/dev/null|wc -l) -gt 0 ]; then
for i in *.ui; do
intltool-extract --type=gettext/glade ${i}
uiname=$(basename $i .ui)
mv -f ${i}.h i18n
xgettext --language=Python --keyword=_ --keyword=N_ --output=i18n/${uiname}.pot i18n/${i}.h
done
fi
popd
fi
done