forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-pot
executable file
·47 lines (39 loc) · 1.21 KB
/
update-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
47
#!/bin/sh
# -*- Mode: sh; indent-tabs-mode: t -*-
set -e
HERE="$(dirname "$0")"
OUTPUT="$HERE/po/snappy.pot"
if [ -n "$1" ]; then
OUTPUT="$1"
fi
# ensure we have our xgettext-go
go install github.com/snapcore/snapd/i18n/xgettext-go
find "$HERE" -name "*.go" -type f -print0 | xargs -0 \
"${GOPATH%%:*}/bin/xgettext-go" \
-o "$OUTPUT" \
--add-comments-tag=TRANSLATORS: \
--no-location \
--sort-output \
--package-name=snappy\
--msgid-bugs-address=snappy-devel@lists.ubuntu.com \
--keyword=i18n.G \
--keyword-plural=i18n.DG
xgettext "$HERE"/data/polkit/*.policy \
-o "$OUTPUT" \
--no-location \
--package-name=snappy \
--msgid-bugs-address=snappy-devel@lists.ubuntu.com \
--join-existing \
|| true
#xgettext -d snappy -o "$OUTPUT" --c++ --from-code=UTF-8 \
# --indent --add-comments=TRANSLATORS: --no-location --sort-output \
# --package-name=snappy \
# --msgid-bugs-address=snappy-devel@lists.ubuntu.com \
# --keyword=NG:1,2 --keyword=G \
# $HERE/*/*.go $HERE/cmd/*/*.go
# language packs
for p in ${HERE}/po/*.po; do
lang=$(basename "$p" .po)
mkdir -p "$HERE/share/locale/$lang/LC_MESSAGES"
msgfmt -v -o "$HERE/share/locale/$lang/LC_MESSAGES/snappy.mo" "$p"
done