Changeset 30155 in osm
- Timestamp:
- 2013-12-28T21:35:45+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/photoadjust
- Files:
-
- 4 added
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/photoadjust
-
Property svn:ignore
set to
josm_trans_*gz
build
po
-
Property svn:ignore
set to
-
applications/editors/josm/plugins/photoadjust/build.xml
r30137 r30155 19 19 See http://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins 20 20 --> 21 <property name="plugin.author" value=" Holger Mappt"/>21 <property name="plugin.author" value="holgermappt"/> 22 22 <property name="plugin.class" value="org.openstreetmap.josm.plugins.photoadjust.PhotoAdjustPlugin"/> 23 23 <property name="plugin.description" value="Make photos movable and position them on the map."/> … … 31 31 <property name="plugin.dist.dir" value="../../dist"/> 32 32 <property name="plugin.javadoc.dir" location="javadoc"/> 33 <property name="gettexttasks.jar" value="../../i18n/lib/gettext-ant-tasks-0.9.7.jar"/>34 33 35 34 <!-- ** include targets that all plugins have in common ** --> 36 35 <import file="../build-common.xml"/> 36 <!-- ** internationalization ** --> 37 <import file="i18n/build-i18n.xml"/> 37 38 38 39 <!-- … … 52 53 </target> 53 54 54 <!-- 55 ********************************************************** 56 ** gettext - string extraction and merge 57 ********************************************************** 58 --> 59 <target name="gettext-init" description="Loads the Ant gettext and contrib tasks."> 60 <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/> 61 </target> 62 <target name="pot" description="Extract translatable strings from source." depends="gettext-init"> 63 <mkdir dir="po"/> 64 <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"> 65 <fileset dir="src" includes="**/*.java"/> 66 </gettext-extract> 67 <echo file="po/${ant.project.name}.pot" append="true"> 68 #. Plugin ${ant.project.name} 69 #: build.xml:1 70 msgid "${plugin.description}" 71 msgstr "" 72 </echo> 73 </target> 74 <target name="pomerge" description="Merge extracted strings into language files."> 75 <exec executable="perl"> 76 <arg line="pomerge.pl"/> 77 </exec> 78 </target> 79 <target name="poimport" description="Import the PO files from the tarball launchpad-export.tar.gz exported from Launchpad."> 80 <exec executable="perl"> 81 <arg line="poimport.pl"/> 82 </exec> 83 </target> 84 <target name="lang" description="Prepare *.lang files in data directory."> 85 <exec executable="perl"> 86 <arg line="../../i18n/i18n.pl data po/*.po"/> 87 </exec> 55 <target name="additional-manifest"> 56 <antcall target="mftrans"/> 88 57 </target> 89 58 </project> -
applications/editors/josm/plugins/photoadjust/i18n/poimport.pl
r30149 r30155 1 1 #! /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 9 poimport.pl - Import the translation from the tarball downloaded from 10 Launchpad. 11 12 =head1 SYNOPSIS 13 14 B<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 19 Import the plugin translations from Launchpad. The argument 20 I<tarball> can be a tarball file that was downloaded from Launchpad, a 21 tarball download URL, a JOSM translation branch revision number 22 (e.g. I<789>), or the keyword I<latest> for the latest revision. 23 Default is to download the latest translation branch revision. 24 25 =head1 OPTIONS 26 27 =over 4 28 29 =item B<--help> 30 31 Prints a brief help message and exits. 32 33 =item B<--man> 34 35 Prints the manual page and exits. 36 37 =item B<--podir> 38 39 Destination directory relative to directory where this script was 40 started in. Default is F<po>. 41 42 =item B<--workdir> 43 44 Temporary directory. A unique directory name that is not used for 45 anything else. Default is F<poimport>. 46 47 =item B<--rmworkdir> 48 49 Remove the temporary directory after the work is done. Disable 50 removal with B<--normworkdir>. Default is to remove the temporary 51 directory. 52 53 =back 54 55 =cut 56 ##################################################################### 5 57 6 58 use strict; … … 9 61 use File::Spec::Functions; 10 62 use File::Basename; 63 use Getopt::Long; 64 use Pod::Usage; 11 65 12 66 ### 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". 68 my $tarball; 69 #$tarball = "launchpad-export.tar.gz"; 15 70 #$tarball = "http://launchpadlibrarian.net/159932691/launchpad-export.tar.gz"; 16 71 #$tarball = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/tarball/747"; 17 72 #$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"; 75 my $workdir = "poimport"; ### Temp. directory. 76 my $rmworkdir = 1; ### Remove the temp. directory (0/1)? 77 my $podir = "po"; ### Destination directory. 78 my $showhelp = 0; ### Show help screen. 79 my $showman = 0; ### Show manual page of this script. 80 81 GetOptions('help|?|h' => \$showhelp, 82 'man' => \$showman, 83 'podir=s' => \$podir, 84 'workdir=s' => \$workdir, 85 'rmworkdir!' => \$rmworkdir, 86 ) or pod2usage(2); 87 88 pod2usage(1) if $showhelp; 89 pod2usage(-exitstatus => 0, -verbose => 2) if $showman; 26 90 27 91 ### Check for arguments. The only supported argument is the tarball. … … 33 97 } 34 98 99 my $josmtburl = "http://bazaar.launchpad.net/~openstreetmap/josm/josm_trans/" 100 . "tarball"; 101 35 102 ### Check for JOSM translation branch revision number. 36 103 if ($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. 107 elsif ($tarball eq "latest") { 108 $tarball = $josmtburl; 39 109 } 40 110 … … 50 120 if ($tarball =~ m:/([^/]+)/tarball/(\d+)$:) { 51 121 $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"; 52 131 } 53 132 else { -
applications/editors/josm/plugins/photoadjust/i18n/pomerge.pl
r30149 r30155 1 1 #! /usr/bin/perl -w 2 ### 3 ### pomerge.pl - Run msgmerge with the files in the po directory and 4 ### remove untranslated strings. 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 9 pomerge.pl - Run msgmerge with the files in the po directory and 10 remove untranslated strings. 11 12 =head1 SYNOPSIS 13 14 B<poimport.pl> [B<--help>] [B<--man>] [B<--podir> I<po>] 15 [B<--project> I<project>] 16 17 =head1 DESCRIPTION 18 19 This script merges the translated strings with the template POT file 20 (msgmerge). It then removes all untranslated strings (msgattrib). 21 The script works with all PO files in the po directory. 22 23 =head1 OPTIONS 24 25 =over 4 26 27 =item B<--help> 28 29 Prints a brief help message and exits. 30 31 =item B<--man> 32 33 Prints the manual page and exits. 34 35 =item B<--podir> 36 37 Directory with PO files that are to be merged. Default is F<po>. 38 39 =item B<--project> 40 41 Project or plugin name. If the name of the template is F<plugin.pot>, 42 then this name is I<plugin>. Default is I<josm>. 43 44 =back 45 46 =cut 47 ##################################################################### 5 48 6 49 use strict; 7 50 use File::Spec::Functions; 51 use Getopt::Long; 52 use Pod::Usage; 8 53 9 ### Directory with PO files that are to be merged. 10 my $podir = "po"; 54 my $podir = "po"; ### Directory with PO files that are merged. 55 my $project = "josm"; ### Project/plugin name. 56 my $showhelp = 0; ### Show help screen. 57 my $showman = 0; ### Show manual page of this script. 58 59 GetOptions('help|?|h' => \$showhelp, 60 'man' => \$showman, 61 'podir=s' => \$podir, 62 'project=s' => \$project, 63 ) or pod2usage(2); 64 65 pod2usage(1) if $showhelp; 66 pod2usage(-exitstatus => 0, -verbose => 2) if $showman; 67 11 68 ### Path to POT file. 12 my $potfile = catfile($podir, "photoadjust.pot");69 my $potfile = catfile($podir, $project . ".pot"); 13 70 14 71 foreach my $pofile (split("\n", `find $podir -name "*.po"`)) {
Note:
See TracChangeset
for help on using the changeset viewer.