mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-29 12:14:31 -06:00
9b20cbd6d2
Better documentation of exactly what m-g-potfiles excludes, and a general clean-up of the script. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13079 57a11ea4-9604-0410-9ed3-97b8803252fd
55 lines
1.6 KiB
Perl
55 lines
1.6 KiB
Perl
#!@-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 or that match the
|
|
# regexp patterns listed in @ignorepatterns.
|
|
#
|
|
# Author: Dave Peticolas <dave@krondo.com>
|
|
|
|
use strict;
|
|
use File::Basename;
|
|
|
|
# Note: These are perl regexp patterns, *not* normal shell wildcards!
|
|
my @ignorepatterns = ('gw-', 'test', 'experimental');
|
|
|
|
my @skipped_files = `grep -v \# @-SRCDIR-@/po/POTFILES.skip`;
|
|
|
|
my @possible_files = `find @-SRCDIR-@/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) {
|
|
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 $path . $name);
|
|
|
|
print $path . $name . "\n";
|
|
}
|
|
|
|
# These are also added, even though they are outside of src/
|
|
print "lib/libqof/backend/file/qsf-backend.c\n";
|
|
print "intl-scm/guile-strings.c\n";
|
|
print "doc/tip_of_the_day.list.in\n"
|