Changeset 13998 in osm for applications/editors/josm


Ignore:
Timestamp:
2009-03-07T21:02:38+01:00 (16 years ago)
Author:
skela
Message:

applications/editors/josm/i18n/build.xml:
Remove the dependence on gettext-ant-tasks, because it does not appear
to be possible to specify a mapping between "he" and "iw_IL" nor to
have msgfmt spit out statistics.

Resurrect the pre-r13964 exec task for invoking "find", but also invoke
"sort" to generate a (hopefully) deterministic list of file names, to
reduce the number of merge conflicts in po/*.po.

Location:
applications/editors/josm/i18n
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/i18n/build.xml

    r13996 r13998  
    1515
    1616  <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>
    2517
    2618  <target name="trans_.java">
     
    4335  </target>
    4436
     37  <target name="java_sourcefiles.txt" depends="trans_.java">
     38    <exec executable="find" osfamily="unix"
     39          output="${i18n.build.dir}/java_sources.txt">
     40      <arg value="${josm.build.dir}/src" />
     41      <arg value="${plugin.dir}"/>
     42      <arg value="${i18n.build.dir}"/>
     43      <arg value="-name"/>
     44      <arg value="*.java"/>
     45    </exec>
     46    <exec executable="sort" osfamily="unix"
     47          output="${i18n.build.dir}/java_sourcefiles.txt">
     48      <arg value="${i18n.build.dir}/java_sources.txt"/>
     49    </exec>
     50    <delete file="${i18n.build.dir}/java_sources.txt"/>
     51  </target>
     52
    4553  <target name="po/josm.pot"
    4654          description="Extracts message keys from the source code"
    47           depends="trans_.java,init.gettext">
    48     <gettext-extract keysFile="josm.pot" poDirectory="po"
    49                      keywords="-k -ktrc -ktr -kmarktr -ktrn:1,2 -ktrl">
    50       <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
    51       <fileset dir="${plugin.dir}" includes="**/*.java"/>
    52       <fileset dir="${i18n.build.dir}" includes="trans_*.java"/>
    53     </gettext-extract>
     55          depends="java_sourcefiles.txt">
     56    <exec executable="xgettext">
     57      <arg line="-ktr -ktrn:1,2 -ktrc -kmarktr -Ljava --from-code=UTF-8 -opo/josm.pot -f${i18n.build.dir}/java_sourcefiles.txt"/>
     58    </exec>
    5459  </target>
    5560
    56   <target name="build" depends="po/josm.pot,init.gettext">
     61  <target name="build" depends="po/josm.pot">
    5762    <copy file="i18n.properties" todir="build/org/openstreetmap/josm" />
    5863
    59     <gettext-merge keysFile="josm.pot" poDirectory="po"/>
    60 
    61     <gettext-dist targetBundle="org.openstreetmap.josm.i18n.Translation"
    62                   poDirectory="po" outputDirectory="build"/>
     64    <ant target="build-lang"><property name="language" value="bg"/></ant>
     65    <ant target="build-lang"><property name="language" value="cs"/></ant>
     66    <ant target="build-lang"><property name="language" value="da"/></ant>
     67    <ant target="build-lang"><property name="language" value="de"/></ant>
     68    <ant target="build-lang"><property name="language" value="el"/></ant>
     69    <ant target="build-lang"><property name="language" value="en_GB"/></ant>
     70    <ant target="build-lang"><property name="language" value="es"/></ant>
     71    <ant target="build-lang"><property name="language" value="fi"/></ant>
     72    <ant target="build-lang"><property name="language" value="fr"/></ant>
     73    <ant target="build-lang"><property name="language" value="he"/><property name="jlanguage" value="iw_IL"/></ant>
     74    <ant target="build-lang"><property name="language" value="ja"/></ant>
     75    <ant target="build-lang"><property name="language" value="it"/></ant>
     76    <ant target="build-lang"><property name="language" value="nl"/></ant>
     77    <ant target="build-lang"><property name="language" value="pl"/></ant>
     78    <ant target="build-lang"><property name="language" value="ro"/></ant>
     79    <ant target="build-lang"><property name="language" value="ru"/></ant>
     80    <ant target="build-lang"><property name="language" value="sk"/></ant>
     81    <ant target="build-lang"><property name="language" value="sl"/></ant>
     82    <ant target="build-lang"><property name="language" value="sv"/></ant>
     83    <ant target="build-lang"><property name="language" value="tr"/></ant>
    6384
    6485    <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
     
    7192    <delete file="REVISION"/>
    7293
    73     <jar destfile="${i18n.jar}" basedir="build" excludes="**/*.java">
     94    <jar destfile="${i18n.jar}" basedir="build"
     95         excludes="trans_*.java java_sourcefiles.txt">
    7496      <manifest>
    7597        <attribute name="Extension-Name" value="JOSM Translation into various languages" />
     
    79101    </jar>
    80102
     103  </target>
     104
     105  <target name="build-lang">
     106    <property name="jlanguage" value="${language}"/>
     107    <exec executable="msgmerge">
     108      <arg line="-U po/${language}.po po/josm.pot"/>
     109    </exec>
     110
     111    <exec executable="msgfmt">
     112      <arg line="--verbose --java2 -dbuild -rorg.openstreetmap.josm.i18n.Translation -l${jlanguage} po/${language}.po"/>
     113    </exec>
    81114  </target>
    82115
Note: See TracChangeset for help on using the changeset viewer.