Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update_ts.sh: add more context
  • Loading branch information
jef-n committed Mar 24, 2019
1 parent 0c23e94 commit e5f0522
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions scripts/processing2ui.pl
Expand Up @@ -39,7 +39,7 @@ sub xmlescape {
my $xml = XMLin($f, ForceArray=>1);

foreach my $k (qw/longname group description/) {
$strings{"OTBAlgorithm"}{$xml->{$k}->[0]} = 1;
$strings{"OTBAlgorithm"}{$xml->{$k}->[0]} = $f;
}
}

Expand All @@ -52,16 +52,16 @@ sub xmlescape {
while( my($class, $name, $description, $rest) = split /\|/, scalar(<I>) ) {
next unless defined $description;
$description =~ s/\s+$//;
$strings{"GrassAlgorithm"}{$description} = 1
$strings{"GrassAlgorithm"}{$description} = $f;
}

close I;

chop $desc;
chop $group;

$strings{"GrassAlgorithm"}{$desc} = 1;
$strings{"GrassAlgorithm"}{$group} = 1;
$strings{"GrassAlgorithm"}{$desc} = $f;
$strings{"GrassAlgorithm"}{$group} = $f;
}

for my $f (<python/plugins/processing/algs/saga/description/*/*.txt>) {
Expand All @@ -86,7 +86,7 @@ sub xmlescape {
$base = uc $base;
my $yaml = LoadFile($f);
for my $k (keys %$yaml) {
$strings{"${base}Algorithm"}{$yaml->{$k}} = 1;
$strings{"${base}Algorithm"}{$yaml->{$k}} = $f;
}
}

Expand All @@ -96,7 +96,7 @@ sub xmlescape {
chop;
s/^.*,//;
foreach my $v (split "/", $_) {
$strings{"AlgorithmClassification"}{$v} = 1;
$strings{"AlgorithmClassification"}{$v} = $f;
}
}
close I;
Expand All @@ -120,7 +120,11 @@ sub xmlescape {

foreach my $v (keys %{ $strings{$k} } ) {
next if $v eq "";
print F " <property><string>" . xmlescape($v) . "</string></property>\n";
my $c = $strings{$k}{$v};
$c =~ s#^.*/##;
$c =~ s#\.[^.]+$##;

print F " <property><string extracomment=\"$c\">" . xmlescape($v) . "</string></property>\n";
}

print F <<EOF;
Expand Down

0 comments on commit e5f0522

Please sign in to comment.