-
Notifications
You must be signed in to change notification settings - Fork 5
/
make-pot
executable file
·46 lines (32 loc) · 1.05 KB
/
make-pot
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
#!/bin/bash
COPYRIGHT_HOLDER="antiX Linux"
PACKAGE_NAME="antiX Development"
BUGS_TO="translation@antixlinux.org"
out_dir="Private/pot/"
cat_file="$out_dir/cli-shell-utils.pot"
str_file="$out_dir/strings"
files="
../live-usb-maker/live-usb-maker
../live-usb-maker/dd-live-usb
../live-kernel-updater/live-kernel-updater
../cli-shell-utils/cli-shell-utils.bash"
xgt_opts="--no-location --add-comments --no-wrap --language=Shell"
ofile_list=
mkdir -p "$out_dir"
all_file="${out_dir%/}/all"
cat $files > "$all_file"
ofile=$cat_file
xgettext $xgt_opts \
--copyright-holder="$COPYRIGHT_HOLDER" \
--package-name="$PACKAGE_NAME" \
--msgid-bugs-address="$BUGS_TO" \
-o "$ofile" "$all_file" 2>/dev/null
sed -i "s/charset=CHARSET/charset=UTF-8/" $ofile
egrep "^(msgid|#\.)" $cat_file | sed "s/^msgid //" | sed -r 's/^"|"$//g' > $str_file
lines=$(grep ^msgid $cat_file | wc -l)
words=$(grep ^msgid $cat_file | wc -w)
words=$((words - lines))
lines=$((lines - 1))
echo
printf "%4s strings to translate\n" $lines
printf "%4s words in the strings\n" $words