Skip to content

Commit

Permalink
Add Ant commands to import and export translations
Browse files Browse the repository at this point in the history
  • Loading branch information
kruton committed Oct 27, 2010
1 parent 3654c28 commit c5a270c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
bin
gen
launchpad-*.tar.gz
2 changes: 1 addition & 1 deletion AndroidManifest.xml
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.connectbot"
android:versionName="1.7.1"
android:versionCode="332"
android:versionCode="333"
android:installLocation="auto">

<application
Expand Down
33 changes: 33 additions & 0 deletions build.xml
Expand Up @@ -46,6 +46,16 @@
<property name="proguard.out.dir" value="${out.dir}/proguard.out"/>
<property name="out.dex.input.absolute.dir" value="${proguard.out.dir}"/>

<!-- Output directory for .po files. -->
<property name="locale.dir" value="locale" />

<!-- Default args to pass to a2po for .po generation. -->
<property name="a2po.args" value="--groups strings --template fortune/fortune.pot --layout 'po/fortune/fortune-%(locale)s.po'"/>

<!-- File names for launchpad translations. -->
<property name="launchpad.export.file" value="launchpad-export.tar.gz"/>
<property name="launchpad.import.file" value="launchpad-import.tar.gz"/>

<target name="check-proguard">
<available file="tools/proguard.jar" property="have.proguard"/>
</target>
Expand Down Expand Up @@ -171,6 +181,29 @@
</fail>
</target>

<!-- Translations come from launchpad.net and are placed in the
locale/ subdirectory. -->
<target name="translations-import">
<untar src="${launchpad.export.file}" dest="${locale.dir}" compression="gzip"/>
<exec executable="a2po" failonerror="true">
<arg value="import"/>
<arg line="${a2po.args}"/>
</exec>
</target>

<!-- Translations are to be uploaded to launchpad.net as a tar ball
created from the locale/ subdirectory. -->
<target name="translations-export">
<exec executable="a2po" failonerror="true">
<arg value="export"/>
<arg line="${a2po.args}"/>
</exec>
<tar destfile="${launchpad.import.file}"
compression="gzip"
basedir="${locale.dir}"
includes="**/*.pot **/*.po" />
</target>

<!-- End custom ConnectBot stuff -->

<taskdef name="setup"
Expand Down
1 change: 1 addition & 0 deletions locale/.gitignore
@@ -0,0 +1 @@
*

0 comments on commit c5a270c

Please sign in to comment.