forked from flyser/cournal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_pot_file.sh
More file actions
executable file
·37 lines (30 loc) · 1.05 KB
/
generate_pot_file.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.05 KB
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
#!/bin/bash
set -e
shopt -s extglob
shopt -s globstar
cd "$(dirname "$0")"
PACKAGE="Cournal"
VERSION=$(grep "__versionstring__ = \".*\"" cournal/__init__.py | cut -f 2 -d \")
OUTPUT="cournal.pot"
AUTHOR="Fabian Henze"
BUGTRACKER="https://github.com/flyser/cournal/issues"
# Generate .glade.h files
for file in cournal/*.glade ; do
intltool-extract --type=gettext/glade "$file"
done
for file in *.desktop.in ; do
intltool-extract --type=gettext/ini "$file"
done
# Create .pot file
xgettext --output="$OUTPUT" --language=Python --package-name="$PACKAGE" \
--copyright-holder="$AUTHOR" --package-version="$VERSION" \
--msgid-bugs-address="$BUGTRACKER" --from-code=UTF-8 \
--keyword=N_ --keyword=_ *.py cournal/*.py cournal/!(twisted)/**/*.py cournal/*.h *.h
sed -i -e "2s/YEAR/$(date +%Y)/" "$OUTPUT"
# Clean up
for file in cournal/*.glade.h *.desktop.in.h ; do
rm "$file"
done
echo ; echo "Created \"$OUTPUT\""
echo "New: msginit -i cournal.pot --locale=de_DE -o i18n/de.po"
echo "Update: msgmerge --update i18n/de.po cournal.pot"