blob: 0dd213a5356624a0e7291b3fc89574c6d97bb224 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/perl
@ARGV >= 1 || die "Usage: $0 <po directory> [<file pattern>]\n";
my $source = shift @ARGV;
my $pattern = shift @ARGV || '*.po';
if( open F, "find $source -type f -name '$pattern' |" )
{
while( chomp( my $file = readline F ) )
{
my ( $basename ) = $file =~ m{.+/([^/]+)\.po$};
if( -f "$source/templates/$basename.pot" )
{
printf "Updating %-40s", $file;
system("msgmerge", "-U", "-N", $file, "$source/templates/$basename.pot");
}
}
close F;
}
|