-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheck_potfiles
executable file
·37 lines (32 loc) · 1.52 KB
/
check_potfiles
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
#!/bin/sh
# Check that po/POTFILES.in is up to date - so we do not forget about any file
# holding a translatable string.
#
# Copyright 2004 Piotr Kupisiewicz <[email protected]>
# 2007 Michał Górny <[email protected]>
# 2005,2011 Marcin Owsiany <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
: ${XGETTEXT=xgettext}
# Exclude contrib subdir - it holds a benchmark program which has a copy of
# every theme string, causing duplicates.
# TODO: we try to obey $srcdir but it will probably fail on anything other than
# ".", as the paths that xgettext will put into the pot file will most likely
# differ from the ones listed in po/POTFILES.in. However the logic necessary to
# strip the right prefix in all possible corner case makes it too much to worry
# about in advance.
$XGETTEXT --keyword=_ --keyword=N_ --output=- `find $srcdir -name '*.[ch]'` | \
sed -ne '/^#:/{s/#://; s/:[0-9]*/\
/g; s/ //g; p;}' | \
grep -v '^$' | sort | uniq | grep -v '^contrib' | \
diff -u po/POTFILES.in -