| [26174] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
|---|
| [11529] | 2 | <project name="JOSM i18n" default="build" basedir=".">
|
|---|
| [26174] | 3 | <!-- compilation properties -->
|
|---|
| 4 | <property name="josm.build.dir" value="../core"/>
|
|---|
| 5 | <property name="josm.presets" value="${josm.build.dir}/data/defaultpresets.xml"/>
|
|---|
| 6 | <property name="plugin.dir" value="../plugins"/>
|
|---|
| [31029] | 7 | <property name="maps.srcfile" value="http://josm.openstreetmap.de/maps"/>
|
|---|
| [31111] | 8 | <property name="wiki.srcfile" value="http://josm.openstreetmap.de/josmfile?mode=en"/>
|
|---|
| [26174] | 9 | <property name="surveyor.srcfile" value="${plugin.dir}/surveyor/resources/surveyor.xml"/>
|
|---|
| 10 | <property name="i18n.build.dir" value="build"/>
|
|---|
| 11 | <property name="i18n.install.dir" value="${josm.build.dir}/data"/>
|
|---|
| [31111] | 12 | <property name="i18n_data.install.dir" value="${josm.build.dir}/data_nodist/trans"/>
|
|---|
| [26174] | 13 | <property name="po.build.dir" value="${i18n.build.dir}"/>
|
|---|
| 14 | <property name="ant.build.javac.target" value="1.5"/>
|
|---|
| 15 | <property name="gettexttasks.jar" value="lib/gettext-ant-tasks-0.9.7.jar"/>
|
|---|
| 16 | <property name="antcontrib.jar" value="lib/ant-contrib-1.0b3.jar"/>
|
|---|
| 17 | <target name="init" description="Loads the Ant gettext and contrib tasks">
|
|---|
| 18 | <taskdef name="gettext-extract" classname="org.xnap.commons.ant.gettext.GettextExtractKeysTask" classpath="${gettexttasks.jar}"/>
|
|---|
| [31111] | 19 | <!-- for the <foreach> possibility -->
|
|---|
| [26174] | 20 | <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${antcontrib.jar}"/>
|
|---|
| 21 | </target>
|
|---|
| [30227] | 22 | <target name="builddir">
|
|---|
| [26174] | 23 | <mkdir dir="${i18n.build.dir}"/>
|
|---|
| [30227] | 24 | </target>
|
|---|
| 25 | <target name="trans_.java" depends="builddir">
|
|---|
| [26174] | 26 | <exec executable="perl" failonerror="true" output="${i18n.build.dir}/trans_presets.java">
|
|---|
| 27 | <arg line="convpreset.pl ${josm.presets}"/>
|
|---|
| 28 | </exec>
|
|---|
| [31029] | 29 | <exec executable="perl" failonerror="true" output="${i18n.build.dir}/trans_maps.java">
|
|---|
| 30 | <arg line="convmaps.pl ${maps.srcfile}"/>
|
|---|
| [26174] | 31 | </exec>
|
|---|
| [30751] | 32 | <exec executable="perl" failonerror="true" output="${i18n.build.dir}/trans_surveyor.java">
|
|---|
| [26174] | 33 | <arg line="convsurveyor.pl ${surveyor.srcfile}"/>
|
|---|
| 34 | </exec>
|
|---|
| [30751] | 35 | <exec executable="perl" failonerror="true" output="${i18n.build.dir}/trans_plugins.java">
|
|---|
| [26174] | 36 | <arg line="convplugins.pl ${plugin.dir}/*/build.xml"/>
|
|---|
| 37 | </exec>
|
|---|
| [31111] | 38 | <exec executable="perl" failonerror="true">
|
|---|
| 39 | <arg line="convwiki.pl ${wiki.srcfile} ${i18n.build.dir}/josmfiles ${i18n.build.dir}/josmfiles.zip"/>
|
|---|
| 40 | </exec>
|
|---|
| [26174] | 41 | <copy file="specialmessages.java" todir="${i18n.build.dir}"/>
|
|---|
| 42 | </target>
|
|---|
| 43 | <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init">
|
|---|
| [31901] | 44 | <gettext-extract keysFile="josm.raw.pot" poDirectory="po" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
|
|---|
| [26174] | 45 | <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
|
|---|
| 46 | <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
|
|---|
| 47 | <fileset dir="${i18n.build.dir}" includes="trans_*.java"/>
|
|---|
| [31111] | 48 | <!-- <fileset dir="${i18n.build.dir}/josmfiles" includes="trans_*.*"/> disable for now -->
|
|---|
| [30239] | 49 | <fileset dir="${josm.build.dir}/data/validator" includes="*.mapcss"/>
|
|---|
| [30621] | 50 | <fileset dir="${josm.build.dir}/styles/standard" includes="*.mapcss"/>
|
|---|
| [26174] | 51 | <fileset dir="${plugin.dir}" includes="**/*.java"/>
|
|---|
| 52 | </gettext-extract>
|
|---|
| [31901] | 53 | <exec executable="msggrep" failonerror="true">
|
|---|
| 54 | <arg line="--msgid --regexp='---DUMMY-MARKER---' --invert-match --output-file=po/josm.pot po/josm.raw.pot"/>
|
|---|
| 55 | </exec>
|
|---|
| 56 | <delete file="po/josm.raw.pot"/>
|
|---|
| [26174] | 57 | </target>
|
|---|
| [31111] | 58 | <target name="po/core.pot" description="Extracts message keys from the JOSM core source code" depends="trans_.java,init">
|
|---|
| [30227] | 59 | <gettext-extract keysFile="core.pot" poDirectory="po" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
|
|---|
| 60 | <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
|
|---|
| 61 | <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
|
|---|
| [31111] | 62 | <fileset dir="${i18n.build.dir}" includes="trans_presets.java"/>
|
|---|
| 63 | <!-- maps should be in data instead, but that requires language file loading support in trac python code -->
|
|---|
| 64 | <fileset dir="${i18n.build.dir}" includes="trans_maps.java"/>
|
|---|
| 65 | <fileset dir="${josm.build.dir}/data/validator" includes="*.mapcss"/>
|
|---|
| 66 | <fileset dir="${josm.build.dir}/styles/standard" includes="*.mapcss"/>
|
|---|
| [30227] | 67 | </gettext-extract>
|
|---|
| 68 | </target>
|
|---|
| [31111] | 69 | <target name="po/data.pot" description="Extracts message keys from data files, e.g., presets, imagery (minus core strings)" depends="trans_.java,po/core.pot,init">
|
|---|
| [30227] | 70 | <gettext-extract keysFile="data.raw.pot" poDirectory="${i18n.build.dir}" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
|
|---|
| [31111] | 71 | <fileset dir="${i18n.build.dir}" includes="trans_plugins.java"/>
|
|---|
| 72 | <!-- <fileset dir="${i18n.build.dir}/josmfiles" includes="trans_*.*"/> -->
|
|---|
| [30227] | 73 | </gettext-extract>
|
|---|
| [31111] | 74 | <copy todir="${po.build.dir}">
|
|---|
| 75 | <fileset dir="po" includes="core.pot"/>
|
|---|
| 76 | </copy>
|
|---|
| [30751] | 77 | <exec executable="msgcomm" failonerror="true" output="po/data.pot">
|
|---|
| [31111] | 78 | <arg line="--unique po/core.pot ${po.build.dir}/core.pot ${i18n.build.dir}/data.raw.pot"/>
|
|---|
| [30227] | 79 | </exec>
|
|---|
| [31111] | 80 | <delete file="${po.build.dir}/core.pot"/>
|
|---|
| 81 | <delete file="${po.build.dir}/data.raw.pot"/>
|
|---|
| [30227] | 82 | </target>
|
|---|
| [31111] | 83 | <target name="po/plugins.pot" description="Extracts message keys from the plugins source code (minus core and data strings)" depends="trans_.java,po/core.pot,po/data.pot,init">
|
|---|
| [30227] | 84 | <gettext-extract keysFile="plugins.raw.pot" poDirectory="${i18n.build.dir}" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
|
|---|
| 85 | <fileset dir="${plugin.dir}" includes="**/*.java"/>
|
|---|
| [31111] | 86 | <fileset dir="${i18n.build.dir}" includes="trans_surveyor.java"/>
|
|---|
| [30227] | 87 | </gettext-extract>
|
|---|
| [31111] | 88 | <copy todir="${po.build.dir}">
|
|---|
| 89 | <fileset dir="po" includes="core.pot"/>
|
|---|
| 90 | <fileset dir="po" includes="data.pot"/>
|
|---|
| 91 | </copy>
|
|---|
| [30751] | 92 | <exec executable="msgcomm" failonerror="true" output="po/plugins.pot">
|
|---|
| [31111] | 93 | <arg line="--unique po/core.pot ${po.build.dir}/core.pot po/data.pot ${po.build.dir}/data.pot ${i18n.build.dir}/plugins.raw.pot"/>
|
|---|
| [30227] | 94 | </exec>
|
|---|
| [31111] | 95 | <delete file="${po.build.dir}/core.pot"/>
|
|---|
| 96 | <delete file="${po.build.dir}/data.pot"/>
|
|---|
| 97 | <delete file="${po.build.dir}/plugins.raw.pot"/>
|
|---|
| [30227] | 98 | </target>
|
|---|
| [31111] | 99 | <target name="build" depends="pot,allpot">
|
|---|
| [31900] | 100 | <antcall target="buildcore"/>
|
|---|
| 101 | <antcall target="buildplugins"/>
|
|---|
| 102 | </target>
|
|---|
| 103 | <target name="buildplugins" depends="init">
|
|---|
| [26174] | 104 | <foreach param="path" target="plugintrans">
|
|---|
| 105 | <path>
|
|---|
| [30754] | 106 | <dirset dir="${plugin.dir}" includes="*" excludes="00_*" />
|
|---|
| [26174] | 107 | </path>
|
|---|
| 108 | </foreach>
|
|---|
| 109 | </target>
|
|---|
| [31111] | 110 | <target name="singleplugintrans" depends="init">
|
|---|
| [30140] | 111 | <antcall target="plugintrans">
|
|---|
| 112 | <param name="path" value="${plugin}"/>
|
|---|
| 113 | </antcall>
|
|---|
| [30139] | 114 | </target>
|
|---|
| [31111] | 115 | <target name="buildcore" depends="po/core.pot,po/data.pot">
|
|---|
| [26928] | 116 | <antcall target="coretrans"/>
|
|---|
| [31111] | 117 | <antcall target="datatrans"/>
|
|---|
| [26928] | 118 | </target>
|
|---|
| [26174] | 119 | <target name="coretrans">
|
|---|
| [30751] | 120 | <exec executable="perl" failonerror="true">
|
|---|
| [31111] | 121 | <arg line="i18n.pl --potfile=po/core.pot --basedir=${i18n.install.dir}/ po/*.po"/>
|
|---|
| [26174] | 122 | </exec>
|
|---|
| 123 | </target>
|
|---|
| [31111] | 124 | <target name="datatrans">
|
|---|
| 125 | <exec executable="perl" failonerror="true">
|
|---|
| 126 | <arg line="i18n.pl --potfile=po/data.pot --basedir=${i18n_data.install.dir}/ po/*.po"/>
|
|---|
| 127 | </exec>
|
|---|
| 128 | </target>
|
|---|
| 129 | <target name="plugintrans">
|
|---|
| [26174] | 130 | <basename file="${path}" property="dir"/>
|
|---|
| 131 | <mkdir dir="${po.build.dir}/plugin_${dir}"/>
|
|---|
| [30751] | 132 | <exec executable="perl" failonerror="true" output="${po.build.dir}/plugin_${dir}/trans_plugin.java">
|
|---|
| [30143] | 133 | <arg line="convplugins.pl ${plugin.dir}/${dir}/build.xml"/>
|
|---|
| 134 | </exec>
|
|---|
| [26174] | 135 | <gettext-extract keysFile="josm.pot" poDirectory="${po.build.dir}/plugin_${dir}" keywords="-k -ktrc:1c,2 -kmarktrc:1c,2 -ktr -kmarktr -ktrn:1,2 -ktrnc:1c,2,3">
|
|---|
| 136 | <fileset dir="${plugin.dir}/${dir}" includes="**/*.java"/>
|
|---|
| [30143] | 137 | <fileset dir="${po.build.dir}/plugin_${dir}" includes="trans_*.java"/>
|
|---|
| [31111] | 138 | <fileset dir="${i18n.build.dir}" includes="trans_${dir}.java"/>
|
|---|
| [26174] | 139 | </gettext-extract>
|
|---|
| 140 | <if>
|
|---|
| 141 | <available file="${po.build.dir}/plugin_${dir}/josm.pot"/>
|
|---|
| 142 | <then>
|
|---|
| [30751] | 143 | <exec executable="perl" failonerror="true">
|
|---|
| [31111] | 144 | <arg line="i18n.pl --potfile=${po.build.dir}/plugin_${dir}/josm.pot --basedir=${plugin.dir}/${dir}/data/ po/*.po"/>
|
|---|
| [26174] | 145 | </exec>
|
|---|
| 146 | </then>
|
|---|
| 147 | </if>
|
|---|
| [31126] | 148 | <delete dir="${po.build.dir}/plugin_${dir}"/>
|
|---|
| [26174] | 149 | </target>
|
|---|
| 150 | <target name="clean">
|
|---|
| 151 | <delete dir="${i18n.build.dir}"/>
|
|---|
| 152 | <delete file="po/josm.pot"/>
|
|---|
| 153 | <delete>
|
|---|
| 154 | <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
|
|---|
| 155 | </delete>
|
|---|
| [26928] | 156 | <delete>
|
|---|
| 157 | <fileset dir="po" includes="*.po" defaultexcludes="false"/>
|
|---|
| 158 | </delete>
|
|---|
| [26174] | 159 | </target>
|
|---|
| [31111] | 160 | <target name="test" depends="pot">
|
|---|
| [26849] | 161 | <mkdir dir="${i18n.build.dir}/test"/>
|
|---|
| [30751] | 162 | <exec executable="perl" failonerror="true">
|
|---|
| [31111] | 163 | <arg line="i18n.pl --potfile=po/josm.pot --basedir=${i18n.build.dir}/test/ po/*.po"/>
|
|---|
| [26849] | 164 | </exec>
|
|---|
| 165 | </target>
|
|---|
| [26928] | 166 | <target name="pot" depends="po/josm.pot" />
|
|---|
| [31111] | 167 | <target name="allpot" depends="po/core.pot,po/data.pot,po/plugins.pot" />
|
|---|
| [26928] | 168 | <target name="update">
|
|---|
| [30751] | 169 | <exec executable="perl" failonerror="true">
|
|---|
| [26928] | 170 | <arg line="launchpad.pl bzronly"/>
|
|---|
| 171 | </exec>
|
|---|
| 172 | <antcall target="build"/>
|
|---|
| 173 | </target>
|
|---|
| 174 | <target name="updatecore">
|
|---|
| [30751] | 175 | <exec executable="perl" failonerror="true">
|
|---|
| [26928] | 176 | <arg line="launchpad.pl bzronly"/>
|
|---|
| 177 | </exec>
|
|---|
| 178 | <antcall target="buildcore"/>
|
|---|
| 179 | </target>
|
|---|
| [11529] | 180 | </project>
|
|---|