1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 15:19:44 +02:00
audacity/locale/find-duplicates.pl
2020-05-22 12:48:49 -04:00

34 lines
611 B
Perl
Executable File

#!/usr/bin/perl
use strict 'vars';
open(my $fh, "<", "audacity.pot")
or die "Can't open < audacity.pot: $!";
my @sourcelines = ();
$\ = "\n";
while (my $line =<$fh>) {
chop $line;
my @tokens = split(/ /, $line, 2);
if ($tokens[0] eq "#:") {
push @sourcelines, split(/ /, $tokens[1]);
}
elsif ($tokens[0] eq "msgid") {
if( @sourcelines > 1) {
print;
my $string = $tokens[1];
do {
print $string;
$string = <$fh>;
chop $string;
} while $string =~ /^"/;
foreach my $sourceline (@sourcelines) {
print $sourceline;
}
}
@sourcelines = ();
}
}