Changeset 24764 in osm for applications/editors/josm
- Timestamp:
- 2010-12-15T23:21:28+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/i18n/convpreset.pl
r23091 r24764 8 8 my $item = ""; 9 9 my $group; 10 my $combo_n; 11 my @combo_values; 12 my $combo_idx; 10 13 my $comment = 0; 11 14 … … 104 107 { 105 108 my ($n,$vals) = ($1,$2); 109 $combo_n = $n; 110 $combo_idx = 0; 106 111 my $vctx = ($line =~ /values_context=(".*?")/) ? $1 : undef; 107 112 if($line =~ /text_context=(".*?")/) … … 113 118 print "/* item $item combo $n */ tr($n);"; 114 119 } 115 foreach my $val (split ",",$vals) 120 $vals =~ s/\\,/\x91/g; 121 @combo_values = split ",",$vals; 122 for (my $i=0; $i<@combo_values; ++$i) { 123 $combo_values[$i] =~ s/\x91/,/g; 124 next if $combo_values[$i] =~ /^[0-9-]+$/; # search for non-numbers 125 print $vctx ? " trc($vctx, \"$combo_values[$i]\");" : " tr(\"$combo_values[$i]\");"; 126 } 127 print "\n"; 128 } 129 elsif($line =~ /<combo.*\s+text=(".*?").*\s+values="(.*?)"/) 130 { 131 my ($n,$vals) = ($1,$2); 132 $combo_n = $n; 133 $combo_idx = 0; 134 my $vctx = ($line =~ /values_context=(".*?")/) ? $1 : undef; 135 if($line =~ /text_context=(".*?")/) 136 { 137 print "/* item $item combo $n */ trc($1,$n);"; 138 } 139 else 140 { 141 print "/* item $item combo $n */ tr($n);"; 142 } 143 @combo_values = split ",",$vals; 144 foreach my $val (@combo_values) 116 145 { 117 146 next if $val =~ /^[0-9-]+$/; # search for non-numbers … … 120 149 print "\n"; 121 150 } 122 elsif($line =~ /<combo.*\s+text=(".*?").*\s+values="(.*?)"/) 123 { 124 my ($n,$vals) = ($1,$2); 125 my $vctx = ($line =~ /values_context=(".*?")/) ? $1 : undef; 126 if($line =~ /text_context=(".*?")/) 127 { 128 print "/* item $item combo $n */ trc($1,$n);"; 129 } 130 else 131 { 132 print "/* item $item combo $n */ tr($n);"; 133 } 134 foreach my $val (split ",",$vals) 135 { 136 next if $val =~ /^[0-9-]+$/; # search for non-numbers 137 print $vctx ? " trc($vctx, \"$val\");" : " tr(\"$val\");"; 138 } 139 print "\n"; 151 elsif($line =~ /<short_description>(.*?)<\/short_description>/) 152 { 153 my $n = $1; 154 print "/* item $item combo $combo_n item \"$combo_values[$combo_idx]\" short description */ tr(\"$n\");\n"; 155 $combo_idx++; 140 156 } 141 157 elsif($line =~ /<\/group>/) … … 148 164 $item = ""; 149 165 print "\n"; 166 } 167 elsif($line =~ /<\/combo/) 168 { 169 $combo_n = ""; 170 $combo_idx = 0; 150 171 } 151 172 elsif(!$line)
Note:
See TracChangeset
for help on using the changeset viewer.