Skip to content

Commit e5f0522

Browse files
committedMar 24, 2019
update_ts.sh: add more context
1 parent 0c23e94 commit e5f0522

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed
 

‎scripts/processing2ui.pl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ sub xmlescape {
3939
my $xml = XMLin($f, ForceArray=>1);
4040

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

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

5858
close I;
5959

6060
chop $desc;
6161
chop $group;
6262

63-
$strings{"GrassAlgorithm"}{$desc} = 1;
64-
$strings{"GrassAlgorithm"}{$group} = 1;
63+
$strings{"GrassAlgorithm"}{$desc} = $f;
64+
$strings{"GrassAlgorithm"}{$group} = $f;
6565
}
6666

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

@@ -96,7 +96,7 @@ sub xmlescape {
9696
chop;
9797
s/^.*,//;
9898
foreach my $v (split "/", $_) {
99-
$strings{"AlgorithmClassification"}{$v} = 1;
99+
$strings{"AlgorithmClassification"}{$v} = $f;
100100
}
101101
}
102102
close I;
@@ -120,7 +120,11 @@ sub xmlescape {
120120

121121
foreach my $v (keys %{ $strings{$k} } ) {
122122
next if $v eq "";
123-
print F " <property><string>" . xmlescape($v) . "</string></property>\n";
123+
my $c = $strings{$k}{$v};
124+
$c =~ s#^.*/##;
125+
$c =~ s#\.[^.]+$##;
126+
127+
print F " <property><string extracomment=\"$c\">" . xmlescape($v) . "</string></property>\n";
124128
}
125129

126130
print F <<EOF;

0 commit comments

Comments
 (0)
Please sign in to comment.