Hiroshi Inoue, with minor modifications by me
}, "src");
foreach (@flist)
{
+ my $prgm = DetermineCatalogName($_);
s/nls.mk/po/;
my $dir = $_;
next unless ($dir =~ /([^\/]+)\/po$/);
- my $prgm = $1;
- $prgm = 'postgres' if ($prgm eq 'backend');
foreach (glob("$dir/*.po"))
{
my $lang;
return $1;
}
+sub DetermineCatalogName
+{
+ my $filename = shift;
+
+ my $f = read_file($filename) || croak "Could not open $filename";
+ $f =~ /CATALOG_NAME\s*\:?=\s*(\S+)/m || croak "Could not determine catalog name in $filename";
+ return $1;
+}
+
sub read_file
{
my $filename = shift;