This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
executable file
·51 lines (50 loc) · 2.11 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="UTF-8"?>
<project name="Scripto" basedir=".">
<property name="lang.dir" location="languages" />
<property name="core.pot" location="../../application/languages/Omeka.pot" />
<target name="update-pot" description="Update the translation template.">
<property name="pot.file" location="${lang.dir}/template.pot"/>
<property name="pot.base" location="${lang.dir}/template.base.pot"/>
<tempfile property="pot.temp" suffix=".pot"/>
<tempfile property="pot.duplicates" suffix="-duplicates.pot" />
<copy file="${pot.base}" tofile="${pot.temp}"/>
<apply executable="xgettext" relative="true" parallel="true" verbose="true">
<arg value="-L"/>
<arg value="php"/>
<arg value="--from-code=utf-8"/>
<arg value="-k__"/>
<arg value="--flag=__:1:pass-php-format"/>
<arg value="--omit-header"/>
<arg value="-j"/>
<arg value="-F"/>
<arg value="-o"/>
<arg file="${pot.temp}"/>
<fileset dir="." includes="**/*.php **/*.phtml" excludes="tests/"/>
</apply>
<exec executable="msgcomm">
<arg value="--omit-header" />
<arg value="-o" />
<arg file="${pot.duplicates}" />
<arg file="${pot.temp}" />
<arg file="${core.pot}" />
</exec>
<exec executable="msgcomm">
<arg value="-u" />
<arg value="-o" />
<arg file="${pot.temp}" />
<arg file="${pot.temp}" />
<arg file="${pot.duplicates}" />
</exec>
<move file="${pot.temp}" tofile="${pot.file}"/>
<delete file="${pot.duplicates}" quiet="true" />
</target>
<target name="build-mo" description="Build the MO translation files.">
<apply executable="msgfmt" dest="${lang.dir}" verbose="true">
<arg value="-o"/>
<targetfile />
<srcfile />
<fileset dir="${lang.dir}" includes="*.po"/>
<mapper type="glob" from="*.po" to="*.mo"/>
</apply>
</target>
</project>