Changeset 26928 in osm for applications/editors


Ignore:
Timestamp:
2011-10-22T21:16:32+02:00 (13 years ago)
Author:
stoecker
Message:

JOSM i18n update

Location:
applications/editors/josm
Files:
37 added
30 deleted
104 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/i18n/build.xml

    r26849 r26928  
    6060        </foreach>
    6161    </target>
     62    <target name="buildcore" depends="po/josm.pot,init">
     63        <gettext-merge keysFile="josm.pot" poDirectory="po"/>
     64        <antcall target="coretrans"/>
     65    </target>
    6266    <target name="coretrans">
    6367        <mkdir dir="${po.build.dir}/core"/>
     
    9397            </then>
    9498        </if>
     99        <delete dir="${po.build.dir}/plugin_${dir}"/>
    95100    </target>
    96101    <target name="clean">
     
    99104        <delete>
    100105            <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
     106        </delete>
     107        <delete>
     108            <fileset dir="po" includes="*.po" defaultexcludes="false"/>
    101109        </delete>
    102110    </target>
     
    107115        </exec>
    108116    </target>
     117    <target name="pot" depends="po/josm.pot" />
     118    <target name="update">
     119        <exec executable="perl">
     120            <arg line="launchpad.pl bzronly"/>
     121        </exec>
     122        <antcall target="build"/>       
     123    </target>
     124    <target name="updatecore">
     125        <exec executable="perl">
     126            <arg line="launchpad.pl bzronly"/>
     127        </exec>
     128        <antcall target="buildcore"/>       
     129    </target>
    109130</project>
  • applications/editors/josm/i18n/launchpad.pl

    r26849 r26928  
    33use strict;
    44
     5my %lang = map {$_ => 1} (
     6"ar", "bg", "cs", "da", "de", "el", "en_AU", "en_GB",
     7"es", "et", "eu", "fi", "fr", "gl", "he", "id", "is",
     8"it", "ja", "nb", "nl", "pl", "pt_BR", "ru", "sk",
     9"sv", "tr", "uk", "zh_CN", "zh_TW"
     10);
     11
    512my $count = 0;#11;
    613my $cleanall = 0;#1;
     14my $upload = 0;#1;
    715
    816if($#ARGV != 0)
    917{
    10     warn "URL not given."
     18    warn "URL not given (try Launchpad download URL or \"bzr\")."
     19}
     20elsif($ARGV[0] eq "bzr" || $ARGV[0] eq "bzronly")
     21{
     22    mkdir "build";
     23    die "Could not change into new data dir." if !chdir "build";
     24    system "bzr export -v josm_trans lp:~openstreetmap/josm/josm_trans";
     25    chdir "..";
     26    copypo("build/josm_trans/josm");
     27    system "rm -rv build/josm_trans";
     28    exit(0) if $ARGV[0] eq "bzronly";
    1129}
    1230else
    1331{
    1432    mkdir "build";
    15     mkdir "build/new";
    16     die "Could not change into new data dir." if !chdir "build/new";
     33    mkdir "build/josm_trans";
     34    die "Could not change into new data dir." if !chdir "build/josm_trans";
    1735    system "wget $ARGV[0]";
    1836    system "tar -xf laun*";
    1937    chdir "../..";
    20     foreach my $name (split("\n", `find build/new -name "*.po"`))
     38    copypo("build/josm_trans");
     39    system "rm -rv build/josm_trans";
     40}
     41
     42system "ant";
     43if($upload)
     44{
     45  my $outdate = `date -u +"%Y-%m-%dT%H_%M_%S"`;
     46  chomp $outdate;
     47  mkdir "build/josm";
     48  system "cp po/*.po po/josm.pot build/josm";
     49  chdir "build";
     50  if(!$count)
     51  {
     52    system "tar -cjf ../launchpad_upload_josm_$outdate.tar.bz2 josm";
     53  }
     54  else
     55  {
     56    my @files = sort glob("josm/*.po");
     57    my $num = 1;
     58    while($#files >= 0)
    2159    {
    22       my $a=$name;
    23       $a =~ s/.*-//;
    24       if(-f "po/$a")
     60      my @f = splice(@files, 0, $count);
     61      system "tar -cjf ../launchpad_upload_josm_${outdate}_$num.tar.bz2 josm/josm.pot ".join(" ",@f);
     62      ++$num;
     63    }
     64  }
     65  system "rm -rv josm";
     66  chdir "..";
     67}
     68
     69sub copypo
     70{
     71    my ($path) = @_;
     72    foreach my $name (split("\n", `find $path -name "*.po"`))
     73    {
     74      $name =~ /([a-zA-Z_]+)\.po/;
     75      if($lang{$1})
    2576      {
    26         system "mv -v $name po/$a";
     77        system "cp -v $name po/$1.po";
    2778      }
    2879      elsif($cleanall)
     
    3384        close FILE;
    3485        $x =~ s/\n\n.*$/\n/s;
    35         open FILE,">","po/$a" or die;
     86        open FILE,">","po/$1.po" or die;
    3687        print FILE $x;
    3788        close FILE;
     
    3990    }
    4091}
    41 system "ant";
    42 my $outdate = `date -u +"%Y-%m-%dT%H_%M_%S"`;
    43 chomp $outdate;
    44 mkdir "build/josm";
    45 system "cp po/*.po po/josm.pot build/josm";
    46 chdir "build";
    47 if(!$count)
    48 {
    49   system "tar -cjf launchpad_upload_josm_$outdate.tar.bz2 josm";
    50 }
    51 else
    52 {
    53   my @files = sort glob("josm/*.po");
    54   my $num = 1;
    55   while($#files >= 0)
    56   {
    57      my @f = splice(@files, 0, $count);
    58      system "tar -cjf launchpad_upload_josm_${outdate}_$num.tar.bz2 josm/josm.pot ".join(" ",@f);
    59      ++$num;
    60   }
    61 }
    62 system "rm -rv josm new";
    63 chdir "..";
  • applications/editors/josm/i18n/po

    • Property svn:ignore
      •  

        old new  
        11josm.pot
         2*.po
         3*~
Note: See TracChangeset for help on using the changeset viewer.