on bionic help sign in
unity8/po/update-unity-pot
53 lines 1.6 kB history raw
1#!/bin/sh
3#
4# Copyright (C) 2017 Canonical Ltd
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License version 3 as
8# published by the Free Software Foundation.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
19set -e
20cd $(dirname $0)
21PO_DIR=$PWD
23PROGNAME=$(basename $0)
25# Create a list of files to scan
26GETTEXT_FILES=$(mktemp --tmpdir unity8.lst.XXXXX)
27trap 'rm -f "$GETTEXT_FILES"' EXIT
28cd ..
29find \( -name '*.h' -o -name '*.cpp' -o -name '*.qml' -o -name '*.js' \) \
30 -a ! \( -path './debian/*' -o -path './builddir/*' -o -path './build/*' -o -path './tests/*' -o -path './.bzr/*' \) | sort \
31> $GETTEXT_FILES
33# Generate pot from our list
34xgettext \
35 --output $PO_DIR/unity8.pot \
36 --from-code=UTF-8 \
37 --files-from $GETTEXT_FILES \
38 --qt --c++ \
39 --add-comments=Translators \
40 --keyword=tr \
41 --keyword=tr:1,2 \
42 --keyword=dtr:2 \
43 --keyword=dtr:2,3 \
44 --keyword=ctr:1c,2 \
45 --keyword=dctr:2c,3 \
46 --keyword=tag \
47 --keyword=tag:1c,2 \
48 --keyword=dgettext_datetime \
49 --package-name="unity8" \
50 --copyright-holder="Canonical Ltd." \
51 --from-code="UTF-8"
53echo "$PROGNAME: $PO_DIR/unity8.pot updated"