Changeset 11669 in josm for trunk/scripts


Ignore:
Timestamp:
2017-03-04T22:25:06+01:00 (8 years ago)
Author:
stoecker
Message:

see #14454 - update presets links

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/scripts/presets_lang.pl

    r11667 r11669  
    4141        $datan{"de"} = "/wiki/Proposed_features/De:Hausnummern";
    4242      }
    43       while($main =~ /<bdi lang="([a-z_A-Z-]+)"(?: style="unicode-bidi:embed;unicode-bidi:-webkit-isolate;unicode-bidi:isolate")?><a href="(\/wiki\/.*?)"/g)
     43      while($main =~ /<a href="(\/wiki\/[^"]+)"[^>]+><b>·<\/b> <bdi lang="([a-z_A-Z-]+)"(?: style="unicode-bidi:embed;unicode-bidi:-webkit-isolate;unicode-bidi:isolate")?>/g)
    4444      {
    45         my $lang = lc($1);
    46         my $val = uri_unescape($2);
     45        my $lang = lc($2);
     46        my $val = uri_unescape($1);
    4747        $lang = "$1_".uc($2) if($lang =~ /^(..)[_-](..)$/);
    4848        $lang = "zh_CN" if $lang eq "zh-hans";
    4949        $lang = "zh_TW" if $lang eq "zh-hant";
    50         $datan{$lang} = $val;
     50        if(-f "data/$lang.lang")
     51        {
     52          $datan{$lang} = $val;
     53        }
     54        else
     55        {
     56          print "Skip lang $lang\n";
     57        }
    5158      }
    5259      while($main =~ /<a href="(\/wiki\/([a-zA-Z-_]):.*?)".*?&#160;&#8226;&#160;/g)
Note: See TracChangeset for help on using the changeset viewer.