-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathextractpot.sh
executable file
·41 lines (35 loc) · 1.12 KB
/
extractpot.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
set -e
message="$1"
cwd="$(pwd)"
if [ -z "$message" ];then
echo "Pass a path to Messages.sh"
exit 1
elif [ "$(basename $message)" != "Messages.sh" ];then
echo "Path passed is not Messages.sh"
exit 1
elif ! type -p perl ;then
echo "perl is not in your PATH"
exit 1
elif ! type -p xgettext ;then
echo "xgettext is not in your PATH"
exit 1
elif ! type -p msgcat ;then
echo "msgcat is not in your PATH"
exit 1
fi
# the address is temporary
gargs="--from-code=UTF-8 -C -kde \
-ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 \
-kki18np:1,2 -kki18ncp:1c,2,3 [email protected]"
export EXTRACTRC="perl $cwd/extractrc.pl" EXTRACTATTR="perl $cwd/extractattr.pl"
export XGETTEXT="$(type -p xgettext) $gargs" XGETTEXT_QT="$(type -p xgettext) $gargs"
export MSGCAT="$(type -p msgcat)"
export podir="$cwd/pots/"
mkdir -pv "$podir"
cd "$(dirname $message)"
source "Messages.sh"
rm -f rc.cpp
echo "All done, use potmerge to merge the files."
echo "You can find them at: $podir"