2001-08-17 03:28:31 -05:00
|
|
|
#!@-PERL-@ -w
|
|
|
|
# -*- perl -*-
|
|
|
|
#
|
|
|
|
# This perl script is used to make po/POTFILES.in, the list
|
2006-02-02 12:47:34 -06:00
|
|
|
# of files to be searched for translatable strings.
|
|
|
|
#
|
2008-01-07 14:19:06 -06:00
|
|
|
# It will exclude any files listed in po/POTFILES.skip, po/POTFILES.ignore
|
|
|
|
# or that match the regexp patterns listed in @ignorepatterns.
|
2001-08-17 03:28:31 -05:00
|
|
|
#
|
|
|
|
# Author: Dave Peticolas <dave@krondo.com>
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use File::Basename;
|
|
|
|
|
2006-02-02 12:47:34 -06:00
|
|
|
# Note: These are perl regexp patterns, *not* normal shell wildcards!
|
2009-03-13 10:07:39 -05:00
|
|
|
my @ignorepatterns = ('gw-', 'test', 'experimental', 'python-bindings', 'swig-.*\.c');
|
2006-02-02 12:47:34 -06:00
|
|
|
|
|
|
|
my @skipped_files = `grep -v \# @-SRCDIR-@/po/POTFILES.skip`;
|
2008-01-07 14:19:06 -06:00
|
|
|
my @ignored_files = `grep -v \# @-SRCDIR-@/po/POTFILES.ignore`;
|
2006-02-02 12:47:34 -06:00
|
|
|
|
2008-01-15 14:40:19 -06:00
|
|
|
my @possible_files = `cd @-SRCDIR-@ && find src -name '*.c' -o -name '*.glade' \\
|
2006-01-18 18:40:32 -06:00
|
|
|
-o -name '*.desktop.in' -o -name '*.keys.in' \\
|
2011-05-31 08:03:09 -05:00
|
|
|
-o -name '*.gschema.xml.in.in' -o -name '*.scm' | sort`;
|
2005-11-14 14:36:33 -06:00
|
|
|
## For perl files add the following:
|
|
|
|
# -o -name '*.pl'
|
2005-11-13 10:20:49 -06:00
|
|
|
|
2006-02-02 12:47:34 -06:00
|
|
|
print "# This is a list of files which contain translatable strings.\n";
|
|
|
|
print "# This file was generated by ../make-gnucash-potfiles.\n";
|
2005-11-14 14:36:33 -06:00
|
|
|
|
2001-08-17 03:28:31 -05:00
|
|
|
my %ignores;
|
2001-09-17 17:27:01 -05:00
|
|
|
foreach my $file (@possible_files) {
|
2006-02-02 12:47:34 -06:00
|
|
|
chomp($file);
|
|
|
|
my ($name, $path) = fileparse($file);
|
|
|
|
$path =~ s/^\.\///;
|
2005-11-14 14:36:33 -06:00
|
|
|
|
2008-01-07 14:19:06 -06:00
|
|
|
foreach my $pat (@ignorepatterns, @skipped_files, @ignored_files) {
|
2006-02-02 12:47:34 -06:00
|
|
|
chomp($pat);
|
|
|
|
next unless $pat;
|
2006-02-01 14:32:11 -06:00
|
|
|
|
2006-02-02 12:47:34 -06:00
|
|
|
if ($file =~ m/$pat/ || $name =~ m/$pat/ || $path =~ m/$pat/) {
|
|
|
|
$ignores{$path . $name} = 1;
|
|
|
|
}
|
2005-11-14 14:36:33 -06:00
|
|
|
}
|
2006-02-02 12:47:34 -06:00
|
|
|
next if $ignores{$path . $name};
|
|
|
|
|
|
|
|
# Ignore unreadable files, e.g. dangling symlinks
|
2008-01-15 14:40:19 -06:00
|
|
|
next unless (-r "@-SRCDIR-@/" . $path . $name);
|
2013-11-05 12:37:45 -06:00
|
|
|
|
|
|
|
# Force parse type for gsettings files
|
|
|
|
my $type = "";
|
|
|
|
if ($file =~ m/.gschema.xml.in.in/ ){
|
|
|
|
$type = "[type: gettext/gsettings]";
|
|
|
|
}
|
2006-02-02 12:47:34 -06:00
|
|
|
|
2013-11-05 12:37:45 -06:00
|
|
|
print $type . $path . $name . "\n";
|
2001-08-17 03:28:31 -05:00
|
|
|
}
|
2001-09-18 05:12:50 -05:00
|
|
|
|
2006-02-01 14:32:11 -06:00
|
|
|
# These are also added, even though they are outside of src/
|
2014-01-24 15:08:30 -06:00
|
|
|
print "src/gnome/gnucash.appdata.xml.in\n";
|
2010-04-22 15:45:22 -05:00
|
|
|
print "src/gnome/gnucash.desktop.in.in\n";
|
2009-04-12 12:14:21 -05:00
|
|
|
print "src/libqof/qof/gnc-date.c\n";
|
2010-05-06 04:01:46 -05:00
|
|
|
print "src/libqof/qof/qofbookslots.h\n";
|
2010-04-22 15:45:22 -05:00
|
|
|
print "doc/tip_of_the_day.list.in\n";
|