forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-pot
executable file
·39 lines (32 loc) · 1000 Bytes
/
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
#!/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
$GOPATH/bin/xgettext-go \
-o "$OUTPUT" \
--add-comments-tag=TRANSLATORS: \
--no-location \
--sort-output \
--package-name=snappy\
--keyword=i18n.G \
--keyword-plural=i18n.DG \
$(find $HERE -name "*.go" -type f)
#xgettext -d snappy -o "$OUTPUT" --c++ --from-code=UTF-8 \
# --indent --add-comments=TRANSLATORS: --no-location --sort-output \
# --package-name=snappy \
# --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