Changeset 13392 in osm
- Timestamp:
- 2009-01-26T10:35:02+01:00 (16 years ago)
- Location:
- applications/editors/josm/i18n
- Files:
-
- 5 edited
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"; -
applications/editors/josm/i18n/convstyle.pl
r13385 r13392 9 9 # but it works with a default Perl installation 10 10 11 # Print a header to write valid Java code. No line break, 12 # so that the input and output line numbers will match. 13 print "class trans_style { void tr(String s){} void f() {"; 14 11 15 while(my $line = <>) 12 16 { … … 14 18 if($line =~ /<rules\s+name=(".*?")/) 15 19 { 16 print "tr($1) /* mappaint style named $1 */\n";20 print "tr($1); /* mappaint style named $1 */\n"; 17 21 } 18 22 elsif($line =~ /colour="([^"]+)#/) 19 23 { 20 print "tr(\"$1\") /* color $1 */\n";24 print "tr(\"$1\"); /* color $1 */\n"; 21 25 } 22 26 else … … 25 29 } 26 30 } 31 32 print "}}\n"; -
applications/editors/josm/i18n/convsurveyor.pl
r12484 r13392 11 11 # This is a simple conversion and in no way a complete XML parser 12 12 # but it works with a default Perl installation 13 14 # Print a header to write valid Java code. No line break, 15 # so that the input and output line numbers will match. 16 print "class trans_surveyor { void tr(String s){} void f() {"; 13 17 14 18 while(my $line = <>) … … 25 29 elsif($line =~ /<button label=\"(.*?)\"/) 26 30 { 27 print "tr(\"$1\") // $_\n";31 print "tr(\"$1\"); // $line\n"; 28 32 } 29 33 else … … 32 36 } 33 37 } 38 39 print "}}\n"; -
applications/editors/josm/i18n/convvalidator.pl
r11529 r13392 11 11 # This is a simple conversion and in no way a complete XML parser 12 12 # but it works with a default Perl installation 13 14 # Print a header to write valid Java code. No line break, 15 # so that the input and output line numbers will match. 16 print "class trans_validator { void tr(String s){} void f() {"; 13 17 14 18 while(my $line = <>) … … 25 29 elsif($line =~ /(.*) *# *(.*) *$/) 26 30 { 27 print "tr(\"$2\") // $1\n";31 print "tr(\"$2\"); // $1\n"; 28 32 } 29 33 else … … 32 36 } 33 37 } 38 39 print "}}\n"; -
applications/editors/josm/i18n/convwms.pl
r12334 r13392 11 11 # This is a simple conversion and in no way a complete XML parser 12 12 # but it works with a default Perl installation 13 14 # Print a header to write valid Java code. No line break, 15 # so that the input and output line numbers will match. 16 print "class trans_wms { void tr(String s){} void f() {"; 13 17 14 18 while(my $line = <>) … … 25 29 elsif($line =~ /^(.*?);(.*?);(.*)$/) 26 30 { 27 print "tr(\"$2\") // $3\n";31 print "tr(\"$2\"); // $3\n"; 28 32 } 29 33 else … … 32 36 } 33 37 } 38 39 print "}}\n";
Note:
See TracChangeset
for help on using the changeset viewer.