Changeset 36453 in osm


Ignore:
Timestamp:
2025-06-13T21:17:19+02:00 (7 months ago)
Author:
stoecker
Message:

don't warn when an argument is used multiple times

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/i18n/i18n.pl

    r36390 r36453  
    283283  }
    284284  # Test two - check if there are {..} which should not be
    285   my @fmt = ();
     285  my %fmt = ();
    286286  my $fmt;
    287287  my $fmte;
    288288  my $fmte1 = "";
    289289  my $trt = $tr; $trt =~ s/'[{}]'//g;
    290   while($trt =~ /\{(.*?)\}/g) {push @fmt,$1};
    291   while($trt =~ /\%([a-z]+)\%/g) {push @fmt,$1};
    292   $fmt = join("_", sort @fmt); @fmt = ();
     290  while($trt =~ /\{(.*?)\}/g) {$fmt{$1}++;}
     291  while($trt =~ /\%([a-z]+)\%/g) {$fmt{$1}++;}
     292  $fmt = join("_", sort keys %fmt); %fmt = ();
    293293  my $ent = $en; $ent =~ s/'[{}]'//g;
    294   while($ent =~ /\{(.*?)\}/g) {push @fmt,$1};
    295   while($ent =~ /\%([a-z]+)\%/g) {push @fmt,$1};
    296   $fmte = join("_", sort @fmt); @fmt = ();
     294  while($ent =~ /\{(.*?)\}/g) {$fmt{$1}++};
     295  while($ent =~ /\%([a-z]+)\%/g) {$fmt{$1}++;}
     296  $fmte = join("_", sort keys %fmt); %fmt = ();
    297297  if($en1)
    298298  {
    299299     my $en1t = $en1; $en1t =~ s/'[{}]'//g;
    300      while($en1t =~ /\{(.*?)\}/g) {push @fmt,$1}; $fmte1 = join("_", sort @fmt);
     300     while($en1t =~ /\{(.*?)\}/g) {$fmt{$1}++;} $fmte1 = join("_", sort keys %fmt);
    301301  }
    302302  if($fmt ne $fmte && $fmt ne $fmte1)
Note: See TracChangeset for help on using the changeset viewer.