diff --git a/i18n/build.xml b/i18n/build.xml
index 7def4d5fc..cf6c945e0 100644
a
|
b
|
|
44 | 44 | </exec> |
45 | 45 | <copy file="specialmessages.java" todir="${i18n.build.dir}"/> |
46 | 46 | </target> |
47 | | <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init"> |
| 47 | <!-- Create the file build/pluginSrc.txt, which contains a list of include patterns for all *.java files that should be translated relative to "${plugin.dir}" --> |
| 48 | <target name="filterpluginsources" depends="init"> |
| 49 | <delete file="${po.build.dir}/pluginSrc.txt"/> |
| 50 | <foreach param="path" target="filterpluginsource"> |
| 51 | <path> |
| 52 | <dirset dir="${plugin.dir}" includes="*" excludes="00_*" /> |
| 53 | </path> |
| 54 | </foreach> |
| 55 | </target> |
| 56 | <!-- Helper task for `filterpluginsources`: Appends an include pattern to the file `build/pluginSrc.txt` if there is no file `.tx/config` for a plugin --> |
| 57 | <target name="filterpluginsource"> |
| 58 | <if> |
| 59 | <not> |
| 60 | <available file="${path}/.tx/config" type="file" /> |
| 61 | </not> |
| 62 | <then> |
| 63 | <basename file="${path}" property="dir"/> |
| 64 | <echo file="${po.build.dir}/pluginSrc.txt" append="true" message="${dir}/**/*.java
"></echo> |
| 65 | </then> |
| 66 | </if> |
| 67 | </target> |
| 68 | <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init,filterpluginsources"> |
48 | 69 | <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"> |
49 | 70 | <!-- core.port --> |
50 | 71 | <fileset dir="${josm.build.dir}/src" includes="**/*.java"/> |
… |
… |
|
57 | 78 | <fileset dir="${i18n.build.dir}" includes="trans_plugins.java"/> |
58 | 79 | <!-- <fileset dir="${i18n.build.dir}/josmfiles" includes="trans_*.*"/> disable for now --> |
59 | 80 | <!-- plugins.pot --> |
60 | | <fileset dir="${plugin.dir}" includes="**/*.java"/> |
| 81 | <fileset dir="${plugin.dir}" includesfile="${po.build.dir}/pluginSrc.txt"/> |
61 | 82 | <fileset dir="${i18n.build.dir}" includes="trans_surveyor.java"/> |
62 | 83 | <fileset dir="${i18n.build.dir}" includes="trans_tag2link.java"/> |
63 | 84 | </gettext-extract> |
… |
… |
|
93 | 114 | </target> |
94 | 115 | <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"> |
95 | 116 | <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"> |
96 | | <fileset dir="${plugin.dir}" includes="**/*.java"/> |
| 117 | <fileset dir="${plugin.dir}" includesfile="${po.build.dir}/pluginSrc.txt"/> |
97 | 118 | <fileset dir="${i18n.build.dir}" includes="trans_surveyor.java"/> |
98 | 119 | <fileset dir="${i18n.build.dir}" includes="trans_tag2link.java"/> |
99 | 120 | </gettext-extract> |
… |
… |
|
138 | 159 | <arg line="i18n.pl --potfile=po/data.pot --basedir=${i18n_data.install.dir}/ po/*.po"/> |
139 | 160 | </exec> |
140 | 161 | </target> |
| 162 | <!-- If the file `josm.pot` is present and the plugin has a `data/` directory, update its *.po files based on the ones in the `po/` directory. --> |
141 | 163 | <target name="plugintrans"> |
142 | 164 | <basename file="${path}" property="dir"/> |
143 | | <mkdir dir="${po.build.dir}/plugin_${dir}"/> |
144 | | <exec executable="perl" failonerror="true" output="${po.build.dir}/plugin_${dir}/trans_plugin.java"> |
145 | | <arg line="convplugins.pl ${plugin.dir}/${dir}/build.xml"/> |
146 | | </exec> |
147 | | <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"> |
148 | | <fileset dir="${plugin.dir}/${dir}" includes="**/*.java"/> |
149 | | <fileset dir="${po.build.dir}/plugin_${dir}" includes="trans_*.java"/> |
150 | | <fileset dir="${i18n.build.dir}" includes="trans_${dir}.java"/> <!-- include plugin specific translation --> |
151 | | </gettext-extract> |
152 | 165 | <if> |
153 | | <available file="${po.build.dir}/plugin_${dir}/josm.pot"/> |
| 166 | <and> |
| 167 | <available file="${po.build.dir}/plugin_${dir}/josm.pot" type="file"/> |
| 168 | <available file="${plugin.dir}/${dir}/data/" type="dir"/> |
| 169 | </and> |
154 | 170 | <then> |
| 171 | <mkdir dir="${po.build.dir}/plugin_${dir}"/> |
| 172 | <exec executable="perl" failonerror="true" output="${po.build.dir}/plugin_${dir}/trans_plugin.java"> |
| 173 | <arg line="convplugins.pl ${plugin.dir}/${dir}/build.xml"/> |
| 174 | </exec> |
| 175 | <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"> |
| 176 | <fileset dir="${plugin.dir}/${dir}" includes="**/*.java"/> |
| 177 | <fileset dir="${po.build.dir}/plugin_${dir}" includes="trans_*.java"/> |
| 178 | <fileset dir="${i18n.build.dir}" includes="trans_${dir}.java"/> <!-- include plugin specific translation --> |
| 179 | </gettext-extract> |
155 | 180 | <exec executable="perl" failonerror="true"> |
156 | 181 | <arg line="i18n.pl --potfile=${po.build.dir}/plugin_${dir}/josm.pot --basedir=${plugin.dir}/${dir}/data/ po/*.po"/> |
157 | 182 | </exec> |
| 183 | <delete dir="${po.build.dir}/plugin_${dir}"/> |
158 | 184 | </then> |
159 | 185 | </if> |
160 | | <delete dir="${po.build.dir}/plugin_${dir}"/> |
161 | 186 | </target> |
162 | 187 | <target name="clean"> |
163 | 188 | <delete dir="${i18n.build.dir}"/> |
… |
… |
|
181 | 206 | <exec executable="perl" failonerror="true"> |
182 | 207 | <arg line="launchpad.pl bzronly"/> |
183 | 208 | </exec> |
184 | | <antcall target="build"/> |
| 209 | <antcall target="build"/> |
185 | 210 | </target> |
186 | 211 | <target name="updatecore"> |
187 | 212 | <exec executable="perl" failonerror="true"> |
188 | 213 | <arg line="launchpad.pl bzronly"/> |
189 | 214 | </exec> |
190 | | <antcall target="buildcore"/> |
| 215 | <antcall target="buildcore"/> |
191 | 216 | </target> |
192 | 217 | </project> |