Skip to content
Permalink
Browse files

update_ts.sh: add more context

  • Loading branch information
jef-n committed Mar 24, 2019
1 parent 0c23e94 commit e5f0522b36f848f09ca1bea1be5a4944ac80fffa
Showing with 11 additions and 7 deletions.
  1. +11 −7 scripts/processing2ui.pl
@@ -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;
}
}

@@ -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>) {
@@ -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;
}
}

@@ -96,7 +96,7 @@ sub xmlescape {
chop;
s/^.*,//;
foreach my $v (split "/", $_) {
$strings{"AlgorithmClassification"}{$v} = 1;
$strings{"AlgorithmClassification"}{$v} = $f;
}
}
close I;
@@ -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;

0 comments on commit e5f0522

Please sign in to comment.
You can’t perform that action at this time.