Changeset 34257 in osm for applications/editors/josm/i18n


Ignore:
Timestamp:
2018-06-06T18:44:25+02:00 (6 years ago)
Author:
donvip
Message:

fix #josm16360 - skip transifex plugins in plugintrans target (patch by floscher)

File:
1 edited

Legend:

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

    r34068 r34257  
    6868    <target name="po/josm.pot" description="Extracts message keys from the source code" depends="trans_.java,init,filterpluginsources">
    6969        <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">
    70             <!-- core.port -->
     70            <!-- core.pot -->
    7171            <fileset dir="${josm.build.dir}/src" includes="**/*.java"/>
    7272            <fileset dir="${i18n.build.dir}" includes="specialmessages.java"/>
     
    161161    </target>
    162162    <!-- 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. -->
     163    <!-- If the plugin has a Transifex config file `.tx/config`, skip this target altogether -->
    163164    <target name="plugintrans">
    164         <basename file="${path}" property="dir"/>
    165         <mkdir dir="${po.build.dir}/plugin_${dir}"/>
    166         <exec executable="perl" failonerror="true" output="${po.build.dir}/plugin_${dir}/trans_plugin.java">
    167             <arg line="convplugins.pl ${plugin.dir}/${dir}/build.xml"/>
    168         </exec>
    169         <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">
    170             <fileset dir="${plugin.dir}/${dir}" includes="**/*.java"/>
    171             <fileset dir="${po.build.dir}/plugin_${dir}" includes="trans_*.java"/>
    172             <fileset dir="${i18n.build.dir}" includes="trans_${dir}.java"/> <!-- include plugin specific translation -->
    173         </gettext-extract>
    174165        <if>
    175             <and>
    176                 <available file="${po.build.dir}/plugin_${dir}/josm.pot" type="file"/>
    177                 <available file="${plugin.dir}/${dir}/data/" type="dir"/>
    178             </and>
     166            <available file="${plugin.dir}/${path}/.tx/config" type="file"/>
    179167            <then>
    180                 <exec executable="perl" failonerror="true">
    181                     <arg line="i18n.pl --potfile=${po.build.dir}/plugin_${dir}/josm.pot --basedir=${plugin.dir}/${dir}/data/ po/*.po"/>
     168                <echo message="Skip plugin ${path}, because it is translated with Transifex!"/>
     169            </then>
     170            <else>
     171                <basename file="${path}" property="dir"/>
     172                <mkdir dir="${po.build.dir}/plugin_${dir}"/>
     173                <exec executable="perl" failonerror="true" output="${po.build.dir}/plugin_${dir}/trans_plugin.java">
     174                    <arg line="convplugins.pl ${plugin.dir}/${dir}/build.xml"/>
    182175                </exec>
    183             </then>
     176                <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">
     177                    <fileset dir="${plugin.dir}/${dir}" includes="**/*.java"/>
     178                    <fileset dir="${po.build.dir}/plugin_${dir}" includes="trans_*.java"/>
     179                    <fileset dir="${i18n.build.dir}" includes="trans_${dir}.java"/> <!-- include plugin specific translation -->
     180                </gettext-extract>
     181                <if>
     182                    <and>
     183                        <available file="${po.build.dir}/plugin_${dir}/josm.pot" type="file"/>
     184                        <available file="${plugin.dir}/${dir}/data/" type="dir"/>
     185                    </and>
     186                    <then>
     187                        <exec executable="perl" failonerror="true">
     188                            <arg line="i18n.pl --potfile=${po.build.dir}/plugin_${dir}/josm.pot --basedir=${plugin.dir}/${dir}/data/ po/*.po"/>
     189                        </exec>
     190                    </then>
     191                </if>
     192                <delete dir="${po.build.dir}/plugin_${dir}"/>
     193            </else>
    184194        </if>
    185         <delete dir="${po.build.dir}/plugin_${dir}"/>
    186195    </target>
    187196    <target name="clean">
Note: See TracChangeset for help on using the changeset viewer.