Print at Dec 20, 2025, 11:04:23 AM View all posts in this thread on one page
Posted by jeffliu at Oct 17, 2012, 11:18:48 AM
Ant tools for translator: buildLang, cleanLang, rollbackLang
Dear all translators.,

For personal convenience, I built 3 ant tasks: buildLang, cleanLang, and rollbackLang.

If that usefull to you, I would be very happy.

You can copy & paste code below to build.xml in the project.
After that , you can type : ant -projecthelp for usage.

Enjoy it !!!

jeff, juain farn, liu @Taiwan, Taipei

any suggestion, please contact me: [email protected]

-----------------------------------------------------------------
<!-- buildLang, cleanLang, rollbackLang are three usefull ant tolls for translator,
you can use buildLang to build the language sh3L file for your language,
and clean all languages with cleanLang,
when you made something wrong and sweetHome 3D not works, you can rollback from previous tranlating works.
Enjoy it !!!
jeff, juain farn liu at Taiwan [email protected]
-->

<target name="buildLang" description="usage: ant buildLang -Dlang=zh_CN">
<!-- usage: ant buildLang -Dlang=zh_CN -->
<!-- this task will create a directory lang/en_US,
and copy all property file with *_zh_CN.properties to the directory
-->

<echo message="starting to build ${lang} language, please waiting..."/>
<mkdir dir="lang/${lang}"/>
<copy todir="lang/${lang}">
<fileset dir="src">
<include name="**/*_${lang}.properties"/>
</fileset>
</copy>
<mkdir dir="lang/${lang}/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}"/>
<copy todir="lang/${lang}/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<fileset dir="src/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<include name="**/*.*"/>
</fileset>
</copy>


<jar destfile="lang/sweetHomeLanguage_${lang}_${version}.sh3L"
basedir="lang/${lang}"
includes="**/*.properties"
/>

<echo message="${lang} language is build, enjoy it !!"/>
</target>

<target name="cleanLang" description="usage: ant cleanLang">
<echo message="starting to clean all languages, please waiting..."/>
<delete dir="lang"/>
<echo message=" all languages are clean"/>
</target>

<target name="rollbackLang" description="usage: ant rollbackLang -Dlang=zh_CN">
<echo message="starting to rollback languages ${lang}, please waiting..."/>
<copy todir="src">
<fileset dir="lang/${lang}">
<include name="**/*_${lang}.properties"/>
</fileset>
</copy>
<copy todir="src/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<fileset dir="lang/${lang}/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<include name="**/*.*"/>
</fileset>
</copy>

<echo message="${lang} language is rollback, enjoy it !!"/>
</target>
---------------------------------------------------------------------

Posted by jeffliu at Oct 18, 2012, 12:49:24 AM
Re: Ant tools for translator: buildLang, cleanLang, rollbackLang
2012/10/18 updated by jeff
---------------------------------------------------------------
<!-- buildLang, cleanLang, rollbackLang are three usefull ant tolls for translator,
you can use buildLang to build the language sh3L file for your language,
and clean all languages with cleanLang,
when you made something wrong and sweetHome 3D not works, you can
rollback from previous tranlating works.

Enjoy it !!!

jeff, juain farn liu at Taiwan [email protected]
-->

<target name="buildLang" description="usage: ant buildLang -Dlang=en_TW">
<!-- usage: ant buildLang -Dlang=en_TW -->
<!-- this task will
1. create a directory lang/zh_TW,
2. copy all property file with *_en_TW.properties to the directory,
3. copy localized resource in com/eteks/sweethome3d/viewcontroller/help/zh_TW
-->

<echo message="starting to build ${lang} language, please waiting..."/>
<mkdir dir="lang/${lang}"/>
<copy todir="lang/${lang}">
<fileset dir="src">
<include name="**/*_${lang}.properties"/>
</fileset>
</copy>
<mkdir dir="lang/${lang}/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}"/>
<copy todir="lang/${lang}/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<fileset dir="src/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<include name="**/*.*"/>
</fileset>
</copy>


<jar destfile="lang/sweetHomeLanguage_${lang}_${version}.sh3L"
basedir="lang/${lang}"
includes="**/*.*"
/>
<tstamp>
<format property="DateSign" pattern="MMddHH"/>
</tstamp>
<jar destfile="lang/sweetHomeLanguage_${lang}_${version}_${DateSign}.sh3L"
basedir="lang/${lang}"
includes="**/*.*"
/>

<echo message="${lang} language is build, enjoy it !!"/>
</target>

<target name="cleanLang" description="usage: ant cleanLang">
<echo message="starting to clean all languages, please waiting..."/>
<delete dir="lang"/>
<echo message=" all languages are clean"/>
</target>

<target name="rollbackLang" description="usage: ant rollbackLang -Dlang=zh_TW">
<echo message="starting to rollback languages ${lang}, please waiting..."/>
<copy todir="src">
<fileset dir="lang/${lang}">
<include name="**/*_${lang}.properties"/>
</fileset>
</copy>
<copy todir="src/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<fileset dir="lang/${lang}/com/eteks/sweethome3d/viewcontroller/resources/help/${lang}">
<include name="**/*.*"/>
</fileset>
</copy>

<echo message="${lang} language is rollback, enjoy it !!"/>
</target>
----------------------------------------------------------------