File: Messages.sh

package info (click to toggle)
gnome-shell-extension-kimpanel 0.0~git20220902.c11f1a6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 208 kB
  • sloc: javascript: 988; sh: 38; xml: 15; makefile: 2
file content (28 lines) | stat: -rwxr-xr-x 784 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

BASEDIR="." # root of translatable sources
PROJECT="gnome-shell-extensions-kimpanel" # project name
BUGADDR="fcitx-dev@googlegroups.com" # MSGID-Bugs
WDIR="`pwd`" # working dir

# see above on sorting

ls *.js | sort > "${WDIR}/infiles.list"

xgettext --from-code=UTF-8 -C  -k_ --msgid-bugs-address="${BUGADDR}" --files-from=infiles.list \
    -D "${BASEDIR}" -D "${WDIR}" -o "po/${PROJECT}.pot" || \
    { echo "error while calling xgettext. aborting."; exit 1; }
echo "Done extracting messages"

echo "Merging translations"
catalogs=`find . -name '*.po'`
for cat in $catalogs; do
    echo "$cat"
    msgmerge -o "$cat.new" "$cat" "po/${PROJECT}.pot"
    mv "$cat.new" "$cat"
done

echo "Done merging translations"
echo "Cleaning up"
rm "${WDIR}/infiles.list"
echo "Done"