Ignore:
Timestamp:
2013-12-28T21:35:45+01:00 (13 years ago)
Author:
holgermappt
Message:

Reorganized i18n.

Location:
applications/editors/josm/plugins/photoadjust
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photoadjust

    • Property svn:ignore set to
      josm_trans_*gz
      build
      po
  • applications/editors/josm/plugins/photoadjust/i18n/poimport.pl

    r30149 r30155  
    11#! /usr/bin/perl -w
    2 ###
    3 ### poimport.pl - Import the translation from the tarball downloaded
    4 ###     from Launchpad.
     2
     3#####################################################################
     4### http://www.perl.com/doc/manual/html/utils/pod2man.html
     5### http://search.cpan.org/dist/perl/pod/perlpod.pod
     6
     7=head1 NAME
     8
     9poimport.pl - Import the translation from the tarball downloaded from
     10Launchpad.
     11
     12=head1 SYNOPSIS
     13
     14B<poimport.pl> [B<--help>] [B<--man>] [B<--podir> I<po>]
     15    [B<--workdir> I<poimport>] [B<--(no)rmworkdir>] I<tarball>
     16
     17=head1 DESCRIPTION
     18
     19Import the plugin translations from Launchpad.  The argument
     20I<tarball> can be a tarball file that was downloaded from Launchpad, a
     21tarball download URL, a JOSM translation branch revision number
     22(e.g. I<789>), or the keyword I<latest> for the latest revision.
     23Default is to download the latest translation branch revision.
     24
     25=head1 OPTIONS
     26
     27=over 4
     28
     29=item B<--help>
     30
     31Prints a brief help message and exits.
     32
     33=item B<--man>
     34
     35Prints the manual page and exits.
     36
     37=item B<--podir>
     38
     39Destination directory relative to directory where this script was
     40started in.  Default is F<po>.
     41
     42=item B<--workdir>
     43
     44Temporary directory.  A unique directory name that is not used for
     45anything else.  Default is F<poimport>.
     46
     47=item B<--rmworkdir>
     48
     49Remove the temporary directory after the work is done.  Disable
     50removal with B<--normworkdir>.  Default is to remove the temporary
     51directory.
     52
     53=back
     54
     55=cut
     56#####################################################################
    557
    658use strict;
     
    961use File::Spec::Functions;
    1062use File::Basename;
     63use Getopt::Long;
     64use Pod::Usage;
    1165
    1266### Name of the tarball downloaded from Launchpad.  Or download URL.
    13 ### Or JOSM translation branch revision number.
    14 my $tarball = "launchpad-export.tar.gz";
     67### Or JOSM translation branch revision number.  Or keyword "latest".
     68my $tarball;
     69#$tarball = "launchpad-export.tar.gz";
    1570#$tarball = "http://launchpadlibrarian.net/159932691/launchpad-export.tar.gz";
    1671#$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball/747";
    1772#$tarball = "747";
    18 ### Temporary directory.  A unique directory name that is not used for
    19 ### anything else.
    20 my $workdir = "importpo";
    21 ### Remove the temp. directory after the work is done (0/1)?
    22 my $rmworkdir = 1;
    23 ### Destination directory relative to directory where this script was
    24 ### started in.
    25 my $podir = "po";
     73#$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball";
     74$tarball = "latest";
     75my $workdir = "poimport";       ### Temp. directory.
     76my $rmworkdir = 1;              ### Remove the temp. directory (0/1)?
     77my $podir = "po";               ### Destination directory.
     78my $showhelp = 0;               ### Show help screen.
     79my $showman = 0;                ### Show manual page of this script.
     80
     81GetOptions('help|?|h'   => \$showhelp,
     82           'man'        => \$showman,
     83           'podir=s'    => \$podir,
     84           'workdir=s'  => \$workdir,
     85           'rmworkdir!' => \$rmworkdir,
     86          ) or pod2usage(2);
     87
     88pod2usage(1) if $showhelp;
     89pod2usage(-exitstatus => 0, -verbose => 2) if $showman;
    2690
    2791### Check for arguments.  The only supported argument is the tarball.
     
    3397}
    3498
     99my $josmtburl = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/"
     100  . "tarball";
     101
    35102### Check for JOSM translation branch revision number.
    36103if ($tarball =~ m/^\d+$/) {
    37   $tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/"
    38     . "tarball/" . $tarball;
     104  $tarball = $josmtburl . "/" . $tarball;
     105}
     106### Or for keyword "latest", i.e. the latest JOSM translation revision.
     107elsif ($tarball eq "latest") {
     108  $tarball = $josmtburl;
    39109}
    40110
     
    50120    if ($tarball =~ m:/([^/]+)/tarball/(\d+)$:) {
    51121      $downfile = $1 . "_" . $2 . ".tar.gz";
     122    }
     123    else {
     124      $downfile .= ".tar.gz";
     125    }
     126  }
     127  elsif ($downfile eq "tarball") {
     128    ### Download of latest revision.
     129    if ($tarball =~ m:/([^/]+)/tarball$:) {
     130      $downfile = $1 . "_latest.tar.gz";
    52131    }
    53132    else {
Note: See TracChangeset for help on using the changeset viewer.