Changeset 17969 in osm for applications/editors/josm/i18n
- Timestamp:
- 2009-10-03T13:57:04+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/i18n/convpreset.pl
r13469 r17969 22 22 if($line =~ /<item\s+name=(".*?")/) 23 23 { 24 print "tr($1); /* item $item */\n";25 $item = $group ? "$group$ 1" : $1;24 my $val = $1; 25 $item = $group ? "$group$val" : $val; 26 26 $item =~ s/""/\//; 27 if($line =~ /name_context=(".*?")/) 28 { 29 print "trc($1, $val); /* item $item */\n"; 30 } 31 else 32 { 33 print "tr($val); /* item $item */\n"; 34 } 27 35 } 28 elsif($line =~ /<group\s+name=(".*?")/) 36 elsif($line =~ /<group.*\s+name=(".*?")/) 29 37 { 30 $group = $1; 31 print "tr($1); /* group $group */\n"; 38 $group = $group ? "$group$1" : $1; 39 $group =~ s/\"\"/\//; 40 if($line =~ /name_context=(".*?")/) 41 { 42 print "trc($1,$group); /* group $group */\n"; 43 } 44 else 45 { 46 print "tr($group); /* group $group */\n"; 47 } 32 48 } 33 elsif($line =~ /<label\s+text=" "/) 49 elsif($line =~ /<label.*\s+text=" "/) 34 50 { 35 51 print "/* item $item empty label */\n"; 36 52 } 37 elsif($line =~ /<label\s+text=(".*?")/) 53 elsif($line =~ /<label.*\s+text=(".*?")/) 38 54 { 39 print "tr($1); /* item $item label $1 */\n"; 55 my $text = $1; 56 if($line =~ /text_context=(".*?")/) 57 { 58 print "trc($1,$text); /* item $item label $text */\n"; 59 } 60 else 61 { 62 print "tr($text); /* item $item label $text */\n"; 63 } 40 64 } 41 elsif($line =~ /<text.*text=(".*?")/) 65 elsif($line =~ /<text.*\s+text=(".*?")/) 42 66 { 43 67 my $n = $1; 44 print "tr($n); /* item $item text $n */\n"; 68 if($line =~ /text_context=(".*?")/) 69 { 70 print "trc($1,$n); /* item $item text $n */\n"; 71 } 72 else 73 { 74 print "tr($n); /* item $item text $n */\n"; 75 } 45 76 } 46 elsif($line =~ /<check.*text=(".*?")/) 77 elsif($line =~ /<check.*\s+text=(".*?")/) 47 78 { 48 79 my $n = $1; 49 print "tr($n); /* item $item check $n */\n"; 80 if($line =~ /text_context=(".*?")/) 81 { 82 print "trc($1,$n); /* item $item check $n */\n"; 83 } 84 else 85 { 86 print "tr($n); /* item $item check $n */\n"; 87 } 50 88 } 51 elsif($line =~ /<role.*text=(".*?")/) 89 elsif($line =~ /<role.*\s+text=(".*?")/) 52 90 { 53 91 my $n = $1; 54 print "tr($n); /* item $item role $n */\n"; 92 if($line =~ /text_context=(".*?")/) 93 { 94 print "trc($1,$n); /* item $item role $n */\n"; 95 } 96 else 97 { 98 print "tr($n); /* item $item role $n */\n"; 99 } 55 100 } 56 101 # first handle display values 57 elsif($line =~ /<combo.*text=(".*?").*display_values="(.*?)"/) 102 elsif($line =~ /<combo.*\s+text=(".*?").*\s+display_values="(.*?)"/) 58 103 { 59 104 my ($n,$vals) = ($1,$2); 60 print "tr($n); /* item $item combo $n */"; 105 my $vctx = ($line =~ /values_context=(".*?")/) ? $1 : undef; 106 if($line =~ /text_context=(".*?")/) 107 { 108 print "trc($1,$n); /* item $item combo $n */"; 109 } 110 else 111 { 112 print "tr($n); /* item $item combo $n */"; 113 } 61 114 foreach my $val (split ",",$vals) 62 115 { 63 116 next if $val =~ /^[0-9-]+$/; # search for non-numbers 64 print " tr(\"$val\");"; 117 print $vctx ? " trc($vctx, \"$val\");" : " tr(\"$val\");"; 65 118 } 66 119 print "\n"; 67 120 } 68 elsif($line =~ /<combo.*text=(".*?").*values="(.*?)"/) 121 elsif($line =~ /<combo.*\s+text=(".*?").*\s+values="(.*?)"/) 69 122 { 70 123 my ($n,$vals) = ($1,$2); 71 print "tr($n); /* item $item combo $n */"; 124 my $vctx = ($line =~ /values_context=(".*?")/) ? $1 : undef; 125 if($line =~ /text_context=(".*?")/) 126 { 127 print "trc($1,$n); /* item $item combo $n */"; 128 } 129 else 130 { 131 print "tr($n); /* item $item combo $n */"; 132 } 72 133 foreach my $val (split ",",$vals) 73 134 { 74 135 next if $val =~ /^[0-9-]+$/; # search for non-numbers 75 print " tr(\"$val\");"; 136 print $vctx ? " trc($vctx, \"$val\");" : " tr(\"$val\");"; 76 137 } 77 138 print "\n"; … … 79 140 elsif($line =~ /<\/group>/) 80 141 { 81 $group = 0; 142 $group = 0 if !($group =~ s/(.*\/).*?$//); 82 143 print "\n"; 83 144 }
Note:
See TracChangeset
for help on using the changeset viewer.