Index: /applications/editors/josm/plugins/photoadjust/build.xml
===================================================================
--- /applications/editors/josm/plugins/photoadjust/build.xml	(revision 30154)
+++ /applications/editors/josm/plugins/photoadjust/build.xml	(revision 30155)
@@ -19,5 +19,5 @@
          See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
     -->
-    <property name="plugin.author" value="Holger Mappt"/>
+    <property name="plugin.author" value="holgermappt"/>
     <property name="plugin.class" value="org.openstreetmap.josm.plugins.photoadjust.PhotoAdjustPlugin"/>
     <property name="plugin.description" value="Make photos movable and position them on the map."/>
@@ -31,8 +31,9 @@
     <property name="plugin.dist.dir" value="../../dist"/>
     <property name="plugin.javadoc.dir" location="javadoc"/>
-    <property name="gettexttasks.jar" value="../../i18n/lib/gettext-ant-tasks-0.9.7.jar"/>
 	
     <!-- ** include targets that all plugins have in common ** -->
     <import file="../build-common.xml"/>
+    <!-- ** internationalization ** -->
+    <import file="i18n/build-i18n.xml"/>
 
     <!--
@@ -52,38 +53,6 @@
     </target>
 
-    <!--
-    **********************************************************
-    ** gettext - string extraction and merge
-    **********************************************************
-    -->
-    <target name="gettext-init" description="Loads the Ant gettext and contrib tasks.">
-        <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/>
-    </target>
-    <target name="pot" description="Extract translatable strings from source." depends="gettext-init">
-        <mkdir dir="po"/>
-        <gettext-extract keysFile="${ant.project.name}.pot" poDirectory="po" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
-            <fileset dir="src" includes="**/*.java"/>
-        </gettext-extract>
-        <echo file="po/${ant.project.name}.pot" append="true">
-#. Plugin ${ant.project.name}
-#: build.xml:1
-msgid "${plugin.description}"
-msgstr ""
-</echo>
-    </target>
-    <target name="pomerge" description="Merge extracted strings into language files.">
-        <exec executable="perl">
-            <arg line="pomerge.pl"/>
-        </exec>
-    </target>
-    <target name="poimport" description="Import the PO files from the tarball launchpad-export.tar.gz exported from Launchpad.">
-        <exec executable="perl">
-            <arg line="poimport.pl"/>
-        </exec>
-    </target>
-    <target name="lang" description="Prepare *.lang files in data directory.">
-        <exec executable="perl">
-            <arg line="../../i18n/i18n.pl data po/*.po"/>
-        </exec>
+    <target name="additional-manifest">
+        <antcall target="mftrans"/>
     </target>
 </project>
Index: /applications/editors/josm/plugins/photoadjust/i18n/build-i18n.xml
===================================================================
--- /applications/editors/josm/plugins/photoadjust/i18n/build-i18n.xml	(revision 30155)
+++ /applications/editors/josm/plugins/photoadjust/i18n/build-i18n.xml	(revision 30155)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+** Internationalization
+** string extraction, merge, language file generation.
+-->
+<project name="plugin_i18n" basedir=".">
+    <property name="gettexttasks.jar" value="../../i18n/lib/gettext-ant-tasks-0.9.7.jar"/>
+    <property name="plugin.po.dir" location="po"/>
+    <property name="plugin.manifest" location="MANIFEST"/>
+
+    <target name="gettext-init" description="Loads the Ant gettext and contrib tasks.">
+        <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/>
+    </target>
+    <target name="pot" description="Extract translatable strings from source." depends="gettext-init">
+        <mkdir dir="${plugin.po.dir}"/>
+        <gettext-extract keysFile="${ant.project.name}.pot" poDirectory="${plugin.po.dir}" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
+            <fileset dir="src" includes="**/*.java"/>
+        </gettext-extract>
+        <echo file="${plugin.po.dir}/${ant.project.name}.pot" append="true">
+#. Plugin ${ant.project.name}
+#: build.xml:1
+msgid "${plugin.description}"
+msgstr ""
+</echo>
+    </target>
+    <target name="pomerge" description="Merge extracted strings into language files.">
+        <exec executable="perl">
+            <arg value="i18n/pomerge.pl"/>
+            <arg value="--podir"/>
+            <arg value="${plugin.po.dir}"/>
+            <arg value="--project"/>
+            <arg value="${ant.project.name}"/>
+        </exec>
+    </target>
+    <target name="poimport" description="Import the PO files from the tarball launchpad-export.tar.gz exported from Launchpad.">
+        <exec executable="perl">
+            <arg value="i18n/poimport.pl"/>
+            <arg value="--podir"/>
+            <arg value="${plugin.po.dir}"/>
+        </exec>
+    </target>
+    <target name="lang" description="Prepare *.lang files in data directory.">
+        <exec executable="perl">
+            <arg line="../../i18n/i18n.pl data ${plugin.po.dir}/*.po"/>
+        </exec>
+    </target>
+    <target name="mftrans" description="Add translations of plugin description to manifest.">
+        <echo message="Adding translations to ${plugin.manifest} ..."/>
+        <exec executable="perl">
+            <arg value="i18n/mftrans.pl"/>
+            <arg value="--manifest"/>
+            <arg value="${plugin.manifest}"/>
+            <arg value="--description"/>
+            <arg value="${plugin.description}"/>
+            <arg value="${plugin.po.dir}/*.po"/>
+        </exec>
+    </target>
+</project>
Index: /applications/editors/josm/plugins/photoadjust/i18n/mftrans.pl
===================================================================
--- /applications/editors/josm/plugins/photoadjust/i18n/mftrans.pl	(revision 30155)
+++ /applications/editors/josm/plugins/photoadjust/i18n/mftrans.pl	(revision 30155)
@@ -0,0 +1,302 @@
+#! /usr/bin/perl -w
+
+#####################################################################
+### http://www.perl.com/doc/manual/html/utils/pod2man.html
+### http://search.cpan.org/dist/perl/pod/perlpod.pod
+
+=head1 NAME
+
+mftrans.pl - Add the translations of the plugin description to
+    the manifest.
+
+=head1 SYNOPSIS
+
+B<poimport.pl> [B<--help>] [B<--man>] [B<--manifest> I<MANIFEST>]
+    B<--description> I<"Plugin description."> I<po/*.po> ...
+
+=head1 DESCRIPTION
+
+Read the translations of the plugin description from the specified PO
+files and add them to the manifest.  Option B<--description> is
+mandatory.  PO files are expected as arguments.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--help>
+
+Prints a brief help message and exits.
+
+=item B<--man>
+
+Prints the manual page and exits.
+
+=item B<--manifest>
+
+Manifest file the translations are added to.  Default is F<MANIFEST>.
+
+=item B<--description>
+
+Plugin description.  The same string that is specified as
+C<plugin.description> in file F<build.xml>.
+
+=back
+
+=cut
+#####################################################################
+
+### This file is based on i18n/i18n.pl.  The functions loadfiles(),
+### copystring(), checkpo() and variables used by those functions are
+### a one-to-one copy.
+
+use utf8;
+#use encoding "utf8";
+binmode STDERR, ":encoding(utf8)";
+use Term::ReadKey;
+use Encode;
+use Getopt::Long;
+use Pod::Usage;
+
+my $waswarn = 0;
+my $maxcount = 0;
+
+main();
+
+sub loadfiles($@)
+{
+  my $desc;
+  my $all;
+  my ($lang,@files) = @_;
+  foreach my $file (@files)
+  {
+    die "Could not open file $file." if(!open FILE,"<:utf8",$file);
+    my $linenum = 0;
+
+    my $cnt = -1; # don't count translators info
+    if($file =~ /\/(.._..(@.+)?)\.po$/ || $file =~ /\/(...?(@.+)?)\.po$/)
+    {
+      my $l = $1;
+      ++$lang->{$l};
+      my %postate = (last => "", type => "");
+      my $linenum = 0;
+      print "Reading file $file\n";
+      while(<FILE>)
+      {
+        ++$linenum;
+        my $fn = "$file:$linenum";
+        chomp;
+        if($_ =~ /^#/ || !$_)
+        {
+          checkpo(\%postate, \%all, $l, "line $linenum in $file", $keys, 1);
+          $postate{fuzzy} = 1 if ($_ =~ /fuzzy/);
+        }
+        elsif($_ =~ /^"(.*)"$/) {$postate{last} .= $1;}
+        elsif($_ =~ /^(msg.+) "(.*)"$/)
+        {
+          my ($n, $d) = ($1, $2);
+          ++$cnt if $n eq "msgid";
+          my $new = !${postate}{fuzzy} && (($n eq "msgid" && $postate{type} ne "msgctxt") || ($n eq "msgctxt"));
+          checkpo(\%postate, \%all, $l, "line $linenum in $file", $keys, $new);
+          $postate{last} = $d;
+          $postate{type} = $n;
+          $postate{src} = $fn if $new;
+        }
+        else
+        {
+          die "Strange line $linenum in $file: $_.";
+        }
+      }
+      checkpo(\%postate, \%all, $l, "line $linenum in $file", $keys, 1);
+    }
+    else
+    {
+      die "File format not supported for file $file.";
+    }
+    $maxcount = $cnt if $cnt > $maxcount;
+    close(FILE);
+  }
+  return %all;
+}
+
+my $alwayspo = 0;
+my $alwaysup = 0;
+my $noask = 0;
+my $conflicts;
+sub copystring($$$$$$$)
+{
+  my ($data, $en, $l, $str, $txt, $context, $ispo) = @_;
+
+  $en = "___${context}___$en" if $context;
+
+  if(exists($data->{$en}{$l}) && $data->{$en}{$l} ne $str)
+  {
+    return if !$str;
+    if($l =~ /^_/)
+    {
+      $data->{$en}{$l} .= ";$str" if !($data->{$en}{$l} =~ /$str/);
+    }
+    elsif(!$data->{$en}{$l})
+    {
+      $data->{$en}{$l} = $str;
+    }
+    else
+    {
+
+      my $f = $data->{$en}{_file} || "";
+      $f = ($f ? "$f;".$data->{$en}{"_src.$l"} : $data->{$en}{"_src.$l"}) if $data->{$en}{"_src.$l"};
+      my $isotherpo = ($f =~ /\.po\:/);
+      my $pomode = ($ispo && !$isotherpo) || (!$ispo && $isotherpo);
+
+      my $mis = "String mismatch for '$en' **$str** ($txt) != **$data->{$en}{$l}** ($f)\n";
+      my $replace = 0;
+
+      if(($conflicts{$l}{$str} || "") eq $data->{$en}{$l}) {}
+      elsif($pomode && $alwaysup) { $replace=$isotherpo; }
+      elsif($pomode && $alwayspo) { $replace=$ispo; }
+      elsif($noask) { print $mis; ++$waswarn; }
+      else
+      {
+        ReadMode 4; # Turn off controls keys
+        my $arg = "(l)eft, (r)ight";
+        $arg .= ", (p)o, (u)pstream[ts/mat], all p(o), all up(s)tream" if $pomode;
+        $arg .= ", e(x)it: ";
+        print "$mis$arg";
+        while((my $c = getc()))
+        {
+          if($c eq "l") { $replace=1; }
+          elsif($c eq "r") {}
+          elsif($c eq "p" && $pomode) { $replace=$ispo; }
+          elsif($c eq "u" && $pomode) { $replace=$isotherpo; }
+          elsif($c eq "o" && $pomode) { $alwayspo = 1; $replace=$ispo; }
+          elsif($c eq "s" && $pomode) { $alwaysup = 1; $replace=$isotherpo; }
+          elsif($c eq "x") { $noask = 1; ++$waswarn; }
+          else { print "\n$arg"; next; }
+          last;
+        }
+        print("\n");
+        ReadMode 0; # Turn on controls keys
+      }
+      if(!$noask)
+      {
+        if($replace)
+        {
+          $data->{$en}{$l} = $str;
+          $conflicts{$l}{$data->{$en}{$l}} = $str;
+        }
+        else
+        {
+          $conflicts{$l}{$str} = $data->{$en}{$l};
+        }
+      }
+    }
+  }
+  else
+  {
+    $data->{$en}{$l} = $str;
+  }
+}
+
+sub checkpo($$$$$$)
+{
+  my ($postate, $data, $l, $txt, $keys, $new) = @_;
+
+  if($postate->{type} eq "msgid") {$postate->{msgid} = $postate->{last};}
+  elsif($postate->{type} eq "msgid_plural") {$postate->{msgid_1} = $postate->{last};}
+  elsif($postate->{type} =~ /^msgstr(\[0\])?$/) {$postate->{msgstr} = $postate->{last};}
+  elsif($postate->{type} =~ /^msgstr\[(.+)\]$/) {$postate->{"msgstr_$1"} = $postate->{last};}
+  elsif($postate->{type} eq "msgctxt") {$postate->{context} = $postate->{last};}
+  elsif($postate->{type}) { die "Strange type $postate->{type} found\n" }
+
+  if($new)
+  {
+    if((!$postate->{fuzzy}) && $postate->{msgstr} && $postate->{msgid})
+    {
+      copystring($data, $postate->{msgid}, $l, $postate->{msgstr},$txt,$postate->{context}, 1);
+      for($i = 1; exists($postate->{"msgstr_$i"}); ++$i)
+      { copystring($data, $postate->{msgid}, "$l.$i", $postate->{"msgstr_$i"},$txt,$postate->{context}, 1); }
+      if($postate->{msgid_1})
+      { copystring($data, $postate->{msgid}, "en.1", $postate->{msgid_1},$txt,$postate->{context}, 1); }
+      copystring($data, $postate->{msgid}, "_src.$l", $postate->{src},$txt,$postate->{context}, 1);
+    }
+    elsif($postate->{msgstr} && !$postate->{msgid})
+    {
+      my %k = ($postate->{msgstr} =~ /(.+?): +(.+?)\\n/g);
+      # take the first one!
+      for $a (sort keys %k)
+      {
+        $keys->{$l}{$a} = $k{$a} if !$keys->{$l}{$a};
+      }
+    }
+    foreach my $k (keys %{$postate})
+    {
+      delete $postate->{$k};
+    }
+    $postate->{type} = $postate->{last} = "";
+  }
+}
+
+### Add translations of plugin description to manifest.  We write an
+### ant build file and call ant to do that.  This way ant will take
+### care of the manifest format details.
+sub addmfdescs($@)
+{
+  my ($manifest, $descs, @langs) = @_;
+  my $buildfile = "build-descs.xml";
+  open FILE,">",$buildfile or die "Could not open file $buildfile: $!";
+  binmode FILE, ":encoding(utf8)";
+  print FILE <<EOT;
+<?xml version="1.0" encoding="utf-8"?>
+<project name="photoadjust" default="descs" basedir=".">
+  <target name="descs">
+    <manifest file="$manifest" mode="update">
+EOT
+  foreach my $la (@langs) {
+    if (exists(${$descs}{$la})) {
+      my $trans = ${$descs}{$la};
+      print FILE "      <attribute name=\"", $la,
+        "_Plugin-Description\" value=\"", $trans, "\"/>\n";
+    }
+  }
+  print FILE <<EOT;
+    </manifest>
+  </target>
+</project>
+EOT
+  close FILE;
+  system "ant -buildfile $buildfile";
+  unlink $buildfile;
+}
+
+sub main
+{
+  my $manifest = "MANIFEST";            ### Manifest file.
+  my $description = "No description.";  ### Plugin description.
+  my $showhelp = 0;                     ### Show help screen.
+  my $showman = 0;                      ### Show manual page of this script.
+
+  GetOptions('help|?|h'      => \$showhelp,
+             'man'           => \$showman,
+             'manifest=s'    => \$manifest,
+             'description=s' => \$description,
+            ) or pod2usage(2);
+
+  pod2usage(1) if $showhelp;
+  pod2usage(-exitstatus => 0, -verbose => 2) if $showman;
+
+  my %lang;
+  my @po;
+  foreach my $arg (@ARGV)
+  {
+    foreach my $f (glob $arg)
+    {
+      if($f =~ /\*/) { printf "Skipping $f\n"; }
+      elsif($f =~ /\.po$/) { push(@po, $f); }
+      else { die "unknown file extension."; }
+    }
+  }
+  my %data = loadfiles(\%lang,@po);
+  my $descs = $data{$description};
+  my @langs = sort keys %lang;
+  addmfdescs($manifest, $descs, @langs);
+}
Index: /applications/editors/josm/plugins/photoadjust/i18n/poimport.pl
===================================================================
--- /applications/editors/josm/plugins/photoadjust/i18n/poimport.pl	(revision 30155)
+++ /applications/editors/josm/plugins/photoadjust/i18n/poimport.pl	(revision 30155)
@@ -0,0 +1,164 @@
+#! /usr/bin/perl -w
+
+#####################################################################
+### http://www.perl.com/doc/manual/html/utils/pod2man.html
+### http://search.cpan.org/dist/perl/pod/perlpod.pod
+
+=head1 NAME
+
+poimport.pl - Import the translation from the tarball downloaded from
+Launchpad.
+
+=head1 SYNOPSIS
+
+B<poimport.pl> [B<--help>] [B<--man>] [B<--podir> I<po>]
+    [B<--workdir> I<poimport>] [B<--(no)rmworkdir>] I<tarball>
+
+=head1 DESCRIPTION
+
+Import the plugin translations from Launchpad.  The argument
+I<tarball> can be a tarball file that was downloaded from Launchpad, a
+tarball download URL, a JOSM translation branch revision number
+(e.g. I<789>), or the keyword I<latest> for the latest revision.
+Default is to download the latest translation branch revision.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--help>
+
+Prints a brief help message and exits.
+
+=item B<--man>
+
+Prints the manual page and exits.
+
+=item B<--podir>
+
+Destination directory relative to directory where this script was
+started in.  Default is F<po>.
+
+=item B<--workdir>
+
+Temporary directory.  A unique directory name that is not used for
+anything else.  Default is F<poimport>.
+
+=item B<--rmworkdir>
+
+Remove the temporary directory after the work is done.  Disable
+removal with B<--normworkdir>.  Default is to remove the temporary
+directory.
+
+=back
+
+=cut
+#####################################################################
+
+use strict;
+use File::Copy;
+use Cwd;
+use File::Spec::Functions;
+use File::Basename;
+use Getopt::Long;
+use Pod::Usage;
+
+### Name of the tarball downloaded from Launchpad.  Or download URL.
+### Or JOSM translation branch revision number.  Or keyword "latest".
+my $tarball;
+#$tarball = "launchpad-export.tar.gz";
+#$tarball = "http://launchpadlibrarian.net/159932691/launchpad-export.tar.gz";
+#$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball/747";
+#$tarball = "747";
+#$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball";
+$tarball = "latest";
+my $workdir = "poimport";       ### Temp. directory.
+my $rmworkdir = 1;              ### Remove the temp. directory (0/1)?
+my $podir = "po";               ### Destination directory.
+my $showhelp = 0;               ### Show help screen.
+my $showman = 0;                ### Show manual page of this script.
+
+GetOptions('help|?|h'   => \$showhelp,
+           'man'        => \$showman,
+           'podir=s'    => \$podir,
+           'workdir=s'  => \$workdir,
+           'rmworkdir!' => \$rmworkdir,
+          ) or pod2usage(2);
+
+pod2usage(1) if $showhelp;
+pod2usage(-exitstatus => 0, -verbose => 2) if $showman;
+
+### Check for arguments.  The only supported argument is the tarball.
+if ($#ARGV == 0) {
+  $tarball = $ARGV[0];
+}
+elsif ($#ARGV > 0) {
+  die "This script accepts only one argument.\n";
+}
+
+my $josmtburl = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/"
+  . "tarball";
+
+### Check for JOSM translation branch revision number.
+if ($tarball =~ m/^\d+$/) {
+  $tarball = $josmtburl . "/" . $tarball;
+}
+### Or for keyword "latest", i.e. the latest JOSM translation revision.
+elsif ($tarball eq "latest") {
+  $tarball = $josmtburl;
+}
+
+### Check if tarball is a URL and download it.  The downloaded file
+### will not be removed and is available for a second import.
+my $downurl;
+if ($tarball =~ m,^http://.+/([^/]+)$,) {
+  ### URL: Download file.
+  $downurl = $tarball;
+  my $downfile = $1;
+  if ($downfile =~ m/^\d+$/) {
+    ### Download of revision number.
+    if ($tarball =~ m:/([^/]+)/tarball/(\d+)$:) {
+      $downfile = $1 . "_" . $2 . ".tar.gz";
+    }
+    else {
+      $downfile .= ".tar.gz";
+    }
+  }
+  elsif ($downfile eq "tarball") {
+    ### Download of latest revision.
+    if ($tarball =~ m:/([^/]+)/tarball$:) {
+      $downfile = $1 . "_latest.tar.gz";
+    }
+    else {
+      $downfile .= ".tar.gz";
+    }
+  }
+  print "Will download file $downfile from $downurl.\n";
+  system("wget -O $downfile $downurl") == 0 or die "wget failed: $?";
+  $tarball = $downfile;
+}
+
+die "Tarball $tarball not found.\n" if (! -r $tarball);
+if (! -d $workdir) {
+  mkdir $workdir or die "Failed to create work directory $workdir: $!";
+}
+copy($tarball, $workdir);
+my $startdir = getcwd();
+chdir $workdir;
+my $tarballfile = basename($tarball);
+system "tar -xf $tarballfile";
+print "Copy language files:";
+foreach my $lpponame (split("\n", `find . -name "*.po"`)) {
+  if ($lpponame =~ /([a-zA-Z_@]+)\.po/) {
+    my $lang = $1;
+    my $poname = $1 . ".po";
+    print " $lang";
+    copy($lpponame, catfile($startdir, $podir, $poname));
+  }
+}
+print "\n";
+
+if ($rmworkdir) {
+  chdir $startdir;
+  system "rm -rf $workdir";
+}
Index: /applications/editors/josm/plugins/photoadjust/i18n/pomerge.pl
===================================================================
--- /applications/editors/josm/plugins/photoadjust/i18n/pomerge.pl	(revision 30155)
+++ /applications/editors/josm/plugins/photoadjust/i18n/pomerge.pl	(revision 30155)
@@ -0,0 +1,93 @@
+#! /usr/bin/perl -w
+
+#####################################################################
+### http://www.perl.com/doc/manual/html/utils/pod2man.html
+### http://search.cpan.org/dist/perl/pod/perlpod.pod
+
+=head1 NAME
+
+pomerge.pl - Run msgmerge with the files in the po directory and
+    remove untranslated strings.
+
+=head1 SYNOPSIS
+
+B<poimport.pl> [B<--help>] [B<--man>] [B<--podir> I<po>]
+    [B<--project> I<project>]
+
+=head1 DESCRIPTION
+
+This script merges the translated strings with the template POT file
+(msgmerge).  It then removes all untranslated strings (msgattrib).
+The script works with all PO files in the po directory.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--help>
+
+Prints a brief help message and exits.
+
+=item B<--man>
+
+Prints the manual page and exits.
+
+=item B<--podir>
+
+Directory with PO files that are to be merged.  Default is F<po>.
+
+=item B<--project>
+
+Project or plugin name.  If the name of the template is F<plugin.pot>,
+then this name is I<plugin>.  Default is I<josm>.
+
+=back
+
+=cut
+#####################################################################
+
+use strict;
+use File::Spec::Functions;
+use Getopt::Long;
+use Pod::Usage;
+
+my $podir = "po";               ### Directory with PO files that are merged.
+my $project = "josm";           ### Project/plugin name.
+my $showhelp = 0;               ### Show help screen.
+my $showman = 0;                ### Show manual page of this script.
+
+GetOptions('help|?|h'  => \$showhelp,
+           'man'       => \$showman,
+           'podir=s'   => \$podir,
+           'project=s' => \$project,
+          ) or pod2usage(2);
+
+pod2usage(1) if $showhelp;
+pod2usage(-exitstatus => 0, -verbose => 2) if $showman;
+
+### Path to POT file.
+my $potfile = catfile($podir, $project . ".pot");
+
+foreach my $pofile (split("\n", `find $podir -name "*.po"`)) {
+  ### Merge translation with template.
+  my $cmd = "msgmerge --quiet --update --backup=none $pofile $potfile";
+  system $cmd;
+
+  ### Get rid of all unneeded translations.  Fuzzy translations are
+  ### removed too.  msgattrib will not write an output file if nothing
+  ### is left.  We move the original file and delete it afterwards to
+  ### preserve only languages with translations.
+  my $potmp = $pofile . ".tmp";
+  rename $pofile, $potmp;
+  $cmd = "msgattrib --output-file=$pofile --translated --no-fuzzy --no-obsolete $potmp";
+  system $cmd;
+  unlink $potmp;
+  if (-z $pofile) {
+    ### The PO file might be empty if there are no translated strings.
+    unlink $pofile;
+  }
+  if (-e $pofile . "~") {
+    ### Remove the backup copy.
+    unlink $pofile . "~";
+  }
+}
Index: plications/editors/josm/plugins/photoadjust/poimport.pl
===================================================================
--- /applications/editors/josm/plugins/photoadjust/poimport.pl	(revision 30154)
+++ 	(revision )
@@ -1,85 +1,0 @@
-#! /usr/bin/perl -w
-###
-### poimport.pl - Import the translation from the tarball downloaded
-###     from Launchpad.
-
-use strict;
-use File::Copy;
-use Cwd;
-use File::Spec::Functions;
-use File::Basename;
-
-### Name of the tarball downloaded from Launchpad.  Or download URL.
-### Or JOSM translation branch revision number.
-my $tarball = "launchpad-export.tar.gz";
-#$tarball = "http://launchpadlibrarian.net/159932691/launchpad-export.tar.gz";
-#$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball/747";
-#$tarball = "747";
-### Temporary directory.  A unique directory name that is not used for
-### anything else.
-my $workdir = "importpo";
-### Remove the temp. directory after the work is done (0/1)?
-my $rmworkdir = 1;
-### Destination directory relative to directory where this script was
-### started in.
-my $podir = "po";
-
-### Check for arguments.  The only supported argument is the tarball.
-if ($#ARGV == 0) {
-  $tarball = $ARGV[0];
-}
-elsif ($#ARGV > 0) {
-  die "This script accepts only one argument.\n";
-}
-
-### Check for JOSM translation branch revision number.
-if ($tarball =~ m/^\d+$/) {
-  $tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/"
-    . "tarball/" . $tarball;
-}
-
-### Check if tarball is a URL and download it.  The downloaded file
-### will not be removed and is available for a second import.
-my $downurl;
-if ($tarball =~ m,^http://.+/([^/]+)$,) {
-  ### URL: Download file.
-  $downurl = $tarball;
-  my $downfile = $1;
-  if ($downfile =~ m/^\d+$/) {
-    ### Download of revision number.
-    if ($tarball =~ m:/([^/]+)/tarball/(\d+)$:) {
-      $downfile = $1 . "_" . $2 . ".tar.gz";
-    }
-    else {
-      $downfile .= ".tar.gz";
-    }
-  }
-  print "Will download file $downfile from $downurl.\n";
-  system("wget -O $downfile $downurl") == 0 or die "wget failed: $?";
-  $tarball = $downfile;
-}
-
-die "Tarball $tarball not found.\n" if (! -r $tarball);
-if (! -d $workdir) {
-  mkdir $workdir or die "Failed to create work directory $workdir: $!";
-}
-copy($tarball, $workdir);
-my $startdir = getcwd();
-chdir $workdir;
-my $tarballfile = basename($tarball);
-system "tar -xf $tarballfile";
-print "Copy language files:";
-foreach my $lpponame (split("\n", `find . -name "*.po"`)) {
-  if ($lpponame =~ /([a-zA-Z_@]+)\.po/) {
-    my $lang = $1;
-    my $poname = $1 . ".po";
-    print " $lang";
-    copy($lpponame, catfile($startdir, $podir, $poname));
-  }
-}
-print "\n";
-
-if ($rmworkdir) {
-  chdir $startdir;
-  system "rm -rf $workdir";
-}
Index: plications/editors/josm/plugins/photoadjust/pomerge.pl
===================================================================
--- /applications/editors/josm/plugins/photoadjust/pomerge.pl	(revision 30154)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#! /usr/bin/perl -w
-###
-### pomerge.pl - Run msgmerge with the files in the po directory and
-###     remove untranslated strings.
-
-use strict;
-use File::Spec::Functions;
-
-### Directory with PO files that are to be merged.
-my $podir = "po";
-### Path to POT file.
-my $potfile = catfile($podir, "photoadjust.pot");
-
-foreach my $pofile (split("\n", `find $podir -name "*.po"`)) {
-  ### Merge translation with template.
-  my $cmd = "msgmerge --quiet --update --backup=none $pofile $potfile";
-  system $cmd;
-
-  ### Get rid of all unneeded translations.  Fuzzy translations are
-  ### removed too.  msgattrib will not write an output file if nothing
-  ### is left.  We move the original file and delete it afterwards to
-  ### preserve only languages with translations.
-  my $potmp = $pofile . ".tmp";
-  rename $pofile, $potmp;
-  $cmd = "msgattrib --output-file=$pofile --translated --no-fuzzy --no-obsolete $potmp";
-  system $cmd;
-  unlink $potmp;
-  if (-z $pofile) {
-    ### The PO file might be empty if there are no translated strings.
-    unlink $pofile;
-  }
-  if (-e $pofile . "~") {
-    ### Remove the backup copy.
-    unlink $pofile . "~";
-  }
-}
