forked from Gnucash/gnucash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-gnucash-potfiles.in
57 lines (46 loc) · 1.83 KB
/
make-gnucash-potfiles.in
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
48
49
50
51
52
53
54
55
56
57
#!@-PERL-@ -w
# -*- perl -*-
#
# This perl script is used to make po/POTFILES.in, the list
# of files to be searched for translatable strings.
#
# It will exclude any files listed in po/POTFILES.skip, po/POTFILES.ignore
# or that match the regexp patterns listed in @ignorepatterns.
#
# Author: Dave Peticolas <[email protected]>
use strict;
use File::Basename;
# Note: These are perl regexp patterns, *not* normal shell wildcards!
my @ignorepatterns = ('gw-', 'test', 'experimental', 'python-bindings', 'swig-.*\.c');
my @skipped_files = `grep -v \# @-SRCDIR-@/po/POTFILES.skip`;
my @ignored_files = `grep -v \# @-SRCDIR-@/po/POTFILES.ignore`;
my @possible_files = `cd @-SRCDIR-@ && find src -name '*.c' -o -name '*.glade' \\
-o -name '*.desktop.in' -o -name '*.keys.in' \\
-o -name '*.schemas.in' |sort`;
## For perl files add the following:
# -o -name '*.pl'
print "# This is a list of files which contain translatable strings.\n";
print "# This file was generated by ../make-gnucash-potfiles.\n";
my %ignores;
foreach my $file (@possible_files) {
chomp($file);
my ($name, $path) = fileparse($file);
$path =~ s/^\.\///;
foreach my $pat (@ignorepatterns, @skipped_files, @ignored_files) {
chomp($pat);
next unless $pat;
if ($file =~ m/$pat/ || $name =~ m/$pat/ || $path =~ m/$pat/) {
$ignores{$path . $name} = 1;
}
}
next if $ignores{$path . $name};
# Ignore unreadable files, e.g. dangling symlinks
next unless (-r "@-SRCDIR-@/" . $path . $name);
print $path . $name . "\n";
}
# These are also added, even though they are outside of src/
print "src/gnome/gnucash.desktop.in.in\n";
print "src/libqof/qof/gnc-date.c\n";
print "src/libqof/qof/qofbookslots.h\n";
print "intl-scm/guile-strings.c\n";
print "doc/tip_of_the_day.list.in\n";