Changeset 19496 in osm for applications/editors/josm/i18n/i18n.pl
- Timestamp:
- 2010-01-13T19:40:10+01:00 (17 years ago)
- File:
-
- 1 edited
-
applications/editors/josm/i18n/i18n.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/i18n/i18n.pl
r19356 r19496 7 7 8 8 my $waswarn = 0; 9 my $maxcount = 0; 9 10 10 11 main(); … … 27 28 my $linenum = 0; 28 29 30 my $cnt = -1; # don't count translators info 29 31 if($file =~ /\/(.._..)\.po$/ || $file =~ /\/(..)\.po$/) 30 32 { … … 48 50 { 49 51 my ($n, $d) = ($1, $2); 52 ++$cnt if $n eq "msgid"; 50 53 my $new = !${postate}{fuzzy} && (($n eq "msgid" && $postate{type} ne "msgctxt") || ($n eq "msgctxt")); 51 54 checkpo(\%postate, \%all, $l, "line $linenum in $file", $keys, $new); … … 65 68 die "File format not supported for file $file."; 66 69 } 70 $maxcount = $cnt if $cnt > $maxcount; 67 71 close(FILE); 68 72 } … … 202 206 { 203 207 my $la; 208 my $cnt = 0; 204 209 if($file =~ /[-_](.._..)\.lang$/ || $file =~ /^(?:.*\/)?(.._..)\.lang$/ || 205 210 $file =~ /[-_](...?)\.lang$/ || $file =~ /^(?:.*\/)?(..)\.lang$/) 206 211 { 207 print "Creating file $file\n";208 212 $la = $1; 209 213 } … … 220 224 if($la eq "en") 221 225 { 226 ++$cnt; 222 227 $val = $en; 223 228 $val =~ s/^___(.*)___/_:$1\n/; … … 228 233 $ennoctx =~ s/^___(.*)___//; 229 234 $val = (exists($data->{$en}{$la})) ? $data->{$en}{$la} : ""; 235 ++$cnt if $val; 230 236 $val = "" if($ennoctx eq $val); 231 237 } … … 242 248 if($la eq "en") 243 249 { 250 ++$cnt; 244 251 $val = $en; 245 252 $val =~ s/^___(.*)___/_:$1\n/; … … 249 256 $val = (exists($data->{$en}{$la})) ? $data->{$en}{$la} : ""; 250 257 --$num if(!$val); 258 ++$cnt if $val; 251 259 if($num == 2) 252 260 { … … 268 276 } 269 277 close FILE; 278 print "Created file $file: Added $cnt strings out of $maxcount.\n"; 270 279 } 271 280 }
Note:
See TracChangeset
for help on using the changeset viewer.
