Changeset 8627 in osm for applications/editors


Ignore:
Timestamp:
2008-07-01T10:20:21+02:00 (16 years ago)
Author:
stoecker
Message:

some cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/lang/convpreset.pl

    r8529 r8627  
    44
    55my $item;
    6 my $line = 1;
    76my $comment = 0;
    87
     
    1615  {
    1716    print "tr(\"$1/ \") /* empty item \"$1\" */\n";
     17  }
     18  elsif($line =~ /<item\s+name=" ".*<\/item>/)
     19  {
     20    print "/* empty item */\n";
    1821  }
    1922  elsif($line =~ /<item\s+name=(".*?")/)
     
    3235  elsif($line =~ /<text.*text=(".*?")/)
    3336  {
    34     print "tr($1) /* item $item text $1 */\n";
     37    my $n = $1;
     38    print "tr($n) /* item $item text $n */\n";
    3539  }
    3640  elsif($line =~ /<check.*text=(".*?")/)
    3741  {
    38     print "tr($1) /* item $item check $1 */\n";
     42    my $n = $1;
     43    print "tr($n) /* item $item check $n */\n";
     44  }
     45  # first handle display values
     46  elsif($line =~ /<combo.*text=(".*?").*display_values="(.*?)"/)
     47  {
     48    my ($n,$vals) = ($1,$2);
     49    print "tr($n) /* item $item combo $n */";
     50    foreach my $val (split ",",$vals)
     51    {
     52      next if $val =~ /^[0-9-]+$/; # search for non-numbers
     53      print " tr(\"$val\")";
     54    }
     55    print "\n";
    3956  }
    4057  elsif($line =~ /<combo.*text=(".*?").*values="(.*?)"/)
    4158  {
    42     print "tr($1) /* item $item combo $1 */";
    43     foreach my $val (split ",",$2)
     59    my ($n,$vals) = ($1,$2);
     60    print "tr($n) /* item $item combo $n */";
     61    foreach my $val (split ",",$vals)
    4462    {
    4563      next if $val =~ /^[0-9-]+$/; # search for non-numbers
Note: See TracChangeset for help on using the changeset viewer.