[11529] | 1 | <project name="JOSM i18n" default="build" basedir=".">
|
---|
| 2 |
|
---|
| 3 | <!-- compilation properties -->
|
---|
[11540] | 4 | <property name="josm.build.dir" value="../core"/>
|
---|
[13140] | 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"/>
|
---|
[12484] | 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"/>
|
---|
[11540] | 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"/>
|
---|
[11576] | 14 | <property name="i18n.jar" value="${i18n.install.dir}/${i18n.name}.jar"/>
|
---|
[11540] | 15 |
|
---|
[11529] | 16 | <property name="ant.build.javac.target" value="1.5"/>
|
---|
| 17 |
|
---|
[14020] | 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 |
|
---|
[13964] | 26 | <target name="trans_.java">
|
---|
| 27 | <mkdir dir="${i18n.build.dir}"/>
|
---|
| 28 | <exec executable="perl" output="${i18n.build.dir}/trans_presets.java">
|
---|
[11529] | 29 | <arg line="convpreset.pl ${josm.presets}"/>
|
---|
| 30 | </exec>
|
---|
[13964] | 31 | <exec executable="perl" output="${i18n.build.dir}/trans_style.java">
|
---|
[13140] | 32 | <arg line="convstyle.pl ${josm.style}"/>
|
---|
| 33 | </exec>
|
---|
[13964] | 34 | <exec executable="perl" output="${i18n.build.dir}/trans_validator.java">
|
---|
[11529] | 35 | <arg line="convvalidator.pl ${validator.tagfile}"/>
|
---|
| 36 | </exec>
|
---|
[13964] | 37 | <exec executable="perl" output="${i18n.build.dir}/trans_wms.java">
|
---|
[12334] | 38 | <arg line="convwms.pl ${wms.srcfile}"/>
|
---|
| 39 | </exec>
|
---|
[13964] | 40 | <exec executable="perl" output="${i18n.build.dir}/trans_surveyor.java">
|
---|
[12484] | 41 | <arg line="convsurveyor.pl ${surveyor.srcfile}"/>
|
---|
| 42 | </exec>
|
---|
[14124] | 43 | <exec executable="perl" output="${i18n.build.dir}/trans_plugins.java">
|
---|
| 44 | <arg line="convplugins.pl ${plugin.dir}/*/build.xml"/>
|
---|
| 45 | </exec>
|
---|
[14020] | 46 | <copy file="specialmessages.java" todir="${i18n.build.dir}" />
|
---|
[13964] | 47 | </target>
|
---|
[11529] | 48 |
|
---|
[13964] | 49 | <target name="po/josm.pot"
|
---|
| 50 | description="Extracts message keys from the source code"
|
---|
[14020] | 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>
|
---|
[11529] | 59 | </target>
|
---|
[11540] | 60 |
|
---|
[14020] | 61 | <target name="build" depends="po/josm.pot,init.gettext">
|
---|
[11540] | 62 | <copy file="i18n.properties" todir="build/org/openstreetmap/josm" />
|
---|
| 63 |
|
---|
[14020] | 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>
|
---|
[13998] | 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>
|
---|
[14951] | 76 | <ant target="build-lang"><property name="language" value="et"/></ant>
|
---|
[13998] | 77 | <ant target="build-lang"><property name="language" value="fi"/></ant>
|
---|
| 78 | <ant target="build-lang"><property name="language" value="fr"/></ant>
|
---|
[14951] | 79 | <ant target="build-lang"><property name="language" value="gl"/></ant>
|
---|
[13998] | 80 | <ant target="build-lang"><property name="language" value="he"/><property name="jlanguage" value="iw_IL"/></ant>
|
---|
| 81 | <ant target="build-lang"><property name="language" value="ja"/></ant>
|
---|
[14020] | 82 | <ant target="build-lang"><property name="language" value="is"/></ant>
|
---|
[13998] | 83 | <ant target="build-lang"><property name="language" value="it"/></ant>
|
---|
[14951] | 84 | <ant target="build-lang"><property name="language" value="nb"/></ant>
|
---|
[13998] | 85 | <ant target="build-lang"><property name="language" value="nl"/></ant>
|
---|
| 86 | <ant target="build-lang"><property name="language" value="pl"/></ant>
|
---|
[16407] | 87 | <ant target="build-lang"><property name="language" value="pt_BR"/></ant>
|
---|
[13998] | 88 | <ant target="build-lang"><property name="language" value="ro"/></ant>
|
---|
| 89 | <ant target="build-lang"><property name="language" value="ru"/></ant>
|
---|
| 90 | <ant target="build-lang"><property name="language" value="sk"/></ant>
|
---|
| 91 | <ant target="build-lang"><property name="language" value="sl"/></ant>
|
---|
| 92 | <ant target="build-lang"><property name="language" value="sv"/></ant>
|
---|
| 93 | <ant target="build-lang"><property name="language" value="tr"/></ant>
|
---|
[16179] | 94 | <ant target="build-lang"><property name="language" value="zh_TW"/></ant>
|
---|
[11540] | 95 |
|
---|
[11529] | 96 | <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
|
---|
| 97 | <env key="LANG" value="C"/>
|
---|
| 98 | <arg value="info"/>
|
---|
| 99 | <arg value="--xml"/>
|
---|
| 100 | <arg value="po"/>
|
---|
| 101 | </exec>
|
---|
| 102 | <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
|
---|
| 103 | <delete file="REVISION"/>
|
---|
[11540] | 104 |
|
---|
[14020] | 105 | <jar destfile="${i18n.jar}" basedir="build" excludes="**/*.java">
|
---|
[11529] | 106 | <manifest>
|
---|
| 107 | <attribute name="Extension-Name" value="JOSM Translation into various languages" />
|
---|
[11540] | 108 | <attribute name="Translation-Version" value="${version.entry.commit.revision}"/>
|
---|
| 109 | <attribute name="Translation-Date" value="${version.entry.commit.date}"/>
|
---|
[11529] | 110 | </manifest>
|
---|
[11540] | 111 | </jar>
|
---|
[11529] | 112 | </target>
|
---|
[11540] | 113 |
|
---|
[13998] | 114 | <target name="build-lang">
|
---|
| 115 | <property name="jlanguage" value="${language}"/>
|
---|
| 116 | <exec executable="msgfmt">
|
---|
| 117 | <arg line="--verbose --java2 -dbuild -rorg.openstreetmap.josm.i18n.Translation -l${jlanguage} po/${language}.po"/>
|
---|
| 118 | </exec>
|
---|
| 119 | </target>
|
---|
| 120 |
|
---|
[11529] | 121 | <target name="clean">
|
---|
| 122 | <delete dir="${i18n.build.dir}" />
|
---|
| 123 | <delete file="po/josm.pot"/>
|
---|
[12547] | 124 | <delete>
|
---|
[14020] | 125 | <fileset dir="po" includes="*.*~" defaultexcludes="false"/>
|
---|
[12547] | 126 | </delete>
|
---|
[11529] | 127 | </target>
|
---|
| 128 |
|
---|
| 129 | </project>
|
---|