source: subversion/applications/editors/josm/i18n/build.xml @ 14124

Last change on this file since 14124 was 14124, checked in by Dirk Stoecker, 11 years ago

added plugin translations

File size: 6.1 KB
Line 
1<project name="JOSM i18n" default="build" basedir=".">
2
3  <!-- compilation properties -->
4  <property name="josm.build.dir"    value="../core"/>
5  <property name="josm.presets"      value="${josm.build.dir}/presets/presets.xml"/>
6  <property name="josm.style"        value="${josm.build.dir}/styles/standard/elemstyles.xml"/>
7  <property name="plugin.dir"        value="../plugins"/>
8  <property name="validator.tagfile" value="${plugin.dir}/validator/tagchecker.cfg"/>
9  <property name="wms.srcfile"       value="${plugin.dir}/wmsplugin/sources.cfg"/>
10  <property name="surveyor.srcfile"  value="${plugin.dir}/surveyor/resources/surveyor.xml"/>
11  <property name="i18n.build.dir"    value="build"/>
12  <property name="i18n.install.dir"  value="${josm.build.dir}/lib"/>
13  <property name="i18n.name"         value="josm-translation"/>
14  <property name="i18n.jar"          value="${i18n.install.dir}/${i18n.name}.jar"/>
15
16  <property name="ant.build.javac.target" value="1.5"/>
17
18  <property name="gettexttasks.jar" value="lib/gettext-ant-tasks-0.9.6.jar"/>
19
20  <target name="init.gettext" description="Loads the Ant gettext tasks">
21    <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/>
22    <taskdef name="gettext-merge" classname="org.xnap.commons.ant.gettext.GettextMergeKeysTask" classpath="${gettexttasks.jar}"/>
23    <taskdef name="gettext-dist" classname="org.xnap.commons.ant.gettext.GettextDistTask" classpath="${gettexttasks.jar}"/>
24  </target>
25
26  <target name="trans_.java">
27    <mkdir dir="${i18n.build.dir}"/>
28    <exec executable="perl" output="${i18n.build.dir}/trans_presets.java">
29      <arg line="convpreset.pl ${josm.presets}"/>
30    </exec>
31    <exec executable="perl" output="${i18n.build.dir}/trans_style.java">
32      <arg line="convstyle.pl ${josm.style}"/>
33    </exec>
34    <exec executable="perl" output="${i18n.build.dir}/trans_validator.java">
35      <arg line="convvalidator.pl ${validator.tagfile}"/>
36    </exec>
37    <exec executable="perl" output="${i18n.build.dir}/trans_wms.java">
38      <arg line="convwms.pl ${wms.srcfile}"/>
39    </exec>
40    <exec executable="perl" output="${i18n.build.dir}/trans_surveyor.java">
41      <arg line="convsurveyor.pl ${surveyor.srcfile}"/>
42    </exec>
43    <exec executable="perl" output="${i18n.build.dir}/trans_plugins.java">
44      <arg line="convplugins.pl ${plugin.dir}/*/build.xml"/>
45    </exec>
46    <copy file="specialmessages.java" todir="${i18n.build.dir}" />
47  </target>
48
49  <target name="po/josm.pot"
50          description="Extracts message keys from the source code"
51          depends="trans_.java,init.gettext">
52    <gettext-extract keysFile="josm.pot" poDirectory="po"
53                     keywords="-k -ktrc -ktr -kmarktr -ktrn:1,2 -ktrl">
54      <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
55      <fileset dir="${plugin.dir}" includes="**/*.java"/>
56      <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
57      <fileset dir="${i18n.build.dir}" includes="trans_*.java"/>
58    </gettext-extract>
59  </target>
60
61  <target name="build" depends="po/josm.pot,init.gettext">
62    <copy file="i18n.properties" todir="build/org/openstreetmap/josm" />
63
64    <gettext-merge keysFile="josm.pot" poDirectory="po"/>
65
66    <!--<gettext-dist targetBundle="org.openstreetmap.josm.i18n.Translation"
67                  poDirectory="po" outputDirectory="build"/>-->
68    <ant target="build-lang"><property name="language" value="ar"/></ant>
69    <ant target="build-lang"><property name="language" value="bg"/></ant>
70    <ant target="build-lang"><property name="language" value="cs"/></ant>
71    <ant target="build-lang"><property name="language" value="da"/></ant>
72    <ant target="build-lang"><property name="language" value="de"/></ant>
73    <ant target="build-lang"><property name="language" value="el"/></ant>
74    <ant target="build-lang"><property name="language" value="en_GB"/></ant>
75    <ant target="build-lang"><property name="language" value="es"/></ant>
76    <ant target="build-lang"><property name="language" value="fi"/></ant>
77    <ant target="build-lang"><property name="language" value="fr"/></ant>
78    <ant target="build-lang"><property name="language" value="he"/><property name="jlanguage" value="iw_IL"/></ant>
79    <ant target="build-lang"><property name="language" value="ja"/></ant>
80    <ant target="build-lang"><property name="language" value="is"/></ant>
81    <ant target="build-lang"><property name="language" value="it"/></ant>
82    <ant target="build-lang"><property name="language" value="nl"/></ant>
83    <ant target="build-lang"><property name="language" value="pl"/></ant>
84    <ant target="build-lang"><property name="language" value="ro"/></ant>
85    <ant target="build-lang"><property name="language" value="ru"/></ant>
86    <ant target="build-lang"><property name="language" value="sk"/></ant>
87    <ant target="build-lang"><property name="language" value="sl"/></ant>
88    <ant target="build-lang"><property name="language" value="sv"/></ant>
89    <ant target="build-lang"><property name="language" value="tr"/></ant>
90
91    <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
92      <env key="LANG" value="C"/>
93      <arg value="info"/>
94      <arg value="--xml"/>
95      <arg value="po"/>
96    </exec>
97    <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
98    <delete file="REVISION"/>
99
100    <jar destfile="${i18n.jar}" basedir="build" excludes="**/*.java">
101      <manifest>
102        <attribute name="Extension-Name" value="JOSM Translation into various languages" />
103        <attribute name="Translation-Version" value="${version.entry.commit.revision}"/>
104        <attribute name="Translation-Date" value="${version.entry.commit.date}"/>
105      </manifest>
106    </jar>
107  </target>
108
109  <target name="build-lang">
110    <property name="jlanguage" value="${language}"/>
111    <exec executable="msgfmt">
112      <arg line="--verbose --java2 -dbuild -rorg.openstreetmap.josm.i18n.Translation -l${jlanguage} po/${language}.po"/>
113    </exec>
114  </target>
115
116  <target name="clean">
117    <delete dir="${i18n.build.dir}" />
118    <delete file="po/josm.pot"/>
119    <delete>
120      <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
121    </delete>
122  </target>
123
124</project>
Note: See TracBrowser for help on using the repository browser.