Changeset 13392 in osm for applications/editors/josm/i18n/convpreset.pl
- Timestamp:
- 2009-01-26T10:35:02+01:00 (18 years ago)
- File:
-
- 1 edited
-
applications/editors/josm/i18n/convpreset.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/i18n/convpreset.pl
r13140 r13392 13 13 # but it works with a default Perl installation 14 14 15 # Print a header to write valid Java code. No line break, 16 # so that the input and output line numbers will match. 17 print "class trans_preset { void tr(String s){} void f() {"; 18 15 19 while(my $line = <>) 16 20 { … … 18 22 if($line =~ /<item\s+name=(".*?")/) 19 23 { 20 print "tr($1) /* item $item */\n"; 24 print "tr($1); /* item $item */\n"; 21 25 $item = $group ? "$group$1" : $1; 22 26 $item =~ s/""/\//; … … 25 29 { 26 30 $group = $1; 27 print "tr($1) /* group $group */\n"; 31 print "tr($1); /* group $group */\n"; 28 32 } 29 33 elsif($line =~ /<label\s+text=" "/) … … 33 37 elsif($line =~ /<label\s+text=(".*?")/) 34 38 { 35 print "tr($1) /* item $item label $1 */\n"; 39 print "tr($1); /* item $item label $1 */\n"; 36 40 } 37 41 elsif($line =~ /<text.*text=(".*?")/) 38 42 { 39 43 my $n = $1; 40 print "tr($n) /* item $item text $n */\n"; 44 print "tr($n); /* item $item text $n */\n"; 41 45 } 42 46 elsif($line =~ /<check.*text=(".*?")/) 43 47 { 44 48 my $n = $1; 45 print "tr($n) /* item $item check $n */\n"; 49 print "tr($n); /* item $item check $n */\n"; 46 50 } 47 51 # first handle display values … … 49 53 { 50 54 my ($n,$vals) = ($1,$2); 51 print "tr($n) /* item $item combo $n */"; 55 print "tr($n); /* item $item combo $n */"; 52 56 foreach my $val (split ",",$vals) 53 57 { 54 58 next if $val =~ /^[0-9-]+$/; # search for non-numbers 55 print " tr(\"$val\")"; 59 print " tr(\"$val\");"; 56 60 } 57 61 print "\n"; … … 60 64 { 61 65 my ($n,$vals) = ($1,$2); 62 print "tr($n) /* item $item combo $n */"; 66 print "tr($n); /* item $item combo $n */"; 63 67 foreach my $val (split ",",$vals) 64 68 { 65 69 next if $val =~ /^[0-9-]+$/; # search for non-numbers 66 print " tr(\"$val\")"; 70 print " tr(\"$val\");"; 67 71 } 68 72 print "\n"; … … 100 104 $comment = 0 if($line =~ /-->/); 101 105 } 106 107 print "}}\n";
Note:
See TracChangeset
for help on using the changeset viewer.
