Skip to content

Commit

Permalink
Add new languages from last checkin to translation registry
Browse files Browse the repository at this point in the history
Bump version
Add build parameters for java version and compiler args
Speed up build for po files
  • Loading branch information
zzz committed Jun 12, 2016
1 parent 6339d3c commit ce02486
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Version key: $major.$minor$type, $type: a(lpha), b(eta), r(elease)c(andidate)]

* 2016-xx-xx 1.105b-1 (zzz)
* 2016-xx-xx 1.106b-1 (zzz)
- Eliminate dependency on deprecated Sha256Standalone
- Allow pushing without "http://" (ticket #1137)
- Update swt (ticket #1297)
Expand Down
23 changes: 23 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@
# copy, call it override.properties, and make the desired changes to that.
#################################################################################

# Compile for this version of Java
javac.version=1.6

#
# Note to packagers, embedders, distributors:
#
# Strictly speaking, you must either use the compiler for the minimum Java version you are
# targeting (default 1.6, see above), or specify a bootclasspath, which means you need
# the JRE for the target version installed as well.
#
# However, in practice, you can compile with 1.7 and target 1.6 without specifying a bootclasspath,
# and it all works fine.
#
# But you cannot compile with 1.8 and target 1.6 or 1.7 without bootclasspath,
# or your users will get runtime errors.
# Below is an example of a bootclasspath that works on Ubuntu.
#
# For more info:
# http://zzz.i2p/topics/1668
# https://gist.github.com/AlainODea/1375759b8720a3f9f094
#
#javac.compilerargs=-bootclasspath /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/jce.jar

# This is the directory the build process will check for the required build dependencies.
# This defaults to 'lib' if left unset. Individual dependency locations can be overridden below.
# Debian users, for example, may want to set this to /usr/share/java
Expand Down
14 changes: 12 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
<property name="swt.mac32" value="${swt.dir}/swt-mac32.jar" />
<property name="swt.mac64" value="${swt.dir}/swt-mac64.jar" />
<property name="tab" value=" " />
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.6" />
<property name="require.gettext" value="true" />
<condition property="no.bundle">
<isfalse value="${require.gettext}" />
Expand Down Expand Up @@ -434,8 +436,9 @@
</not>
</condition>
</fail>
<javac srcdir="${src.dir}" destdir="${build.dir}/obj" debug="true" source="1.6" target="1.6"
<javac srcdir="${src.dir}" destdir="${build.dir}/obj" debug="true" source="${javac.version}" target="${javac.version}"
deprecation="on" includeAntRuntime="false">
<compilerarg line="${javac.compilerargs}" />
<classpath>
<path refid="classpath.build" />
</classpath>
Expand All @@ -445,9 +448,10 @@
<target name="compile-cli" depends="init" description="compile just the cli">
<delete dir="${build.dir}/cli-obj" />
<mkdir dir="${build.dir}/cli-obj" />
<javac srcdir="${src.dir}" destdir="${build.dir}/cli-obj" debug="true" source="1.6" target="1.6"
<javac srcdir="${src.dir}" destdir="${build.dir}/cli-obj" debug="true" source="${javac.version}" target="${javac.version}"
excludes="syndie/gui/** syndie/trac/** com/** syndie/locale/** imports/Browser/** imports/DesktopUI/**"
deprecation="on" includeAntRuntime="false">
<compilerarg line="${javac.compilerargs}" />
<classpath>
<pathelement location="${i2p.jar}" />
<pathelement location="${hsqldb.jar}" />
Expand All @@ -456,6 +460,7 @@
</target>

<target name="bundle" depends="compile" description="process the translations" unless="no.bundle">
<mkdir dir="build/messages-src" />
<!-- Update the messages_*.po files -->
<exec executable="sh" osfamily="unix" failifexecutionfails="true" failonerror="${require.gettext}" >
<arg value="./bundle-messages.sh" />
Expand All @@ -466,6 +471,11 @@
<exec executable="sh" osfamily="windows" failifexecutionfails="false" >
<arg value="./bundle-messages.sh" />
</exec>
<javac source="${javac.version}" target="${javac.version}"
includeAntRuntime="false"
srcdir="build/messages-src" destdir="build/obj">
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>

<target name="poupdate" depends="compile" description="generate the translation files">
Expand Down
39 changes: 32 additions & 7 deletions bundle-messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,40 @@ do
# only generate for non-source language
echo "Generating ${CLASS}_$LG ResourceBundle..."

# convert to class files in build
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
msgfmt -V | grep -q '0\.19'
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build/syndie/messages -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
# slow way
# convert to class files in build
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build/syndie/messages -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
else
# fast way
# convert to java files in build/messages-src
TD=build/messages-src-tmp
TDX=$TD/syndie/locale
TD2=build/messages-src
TDY=$TD2/syndie/locale
rm -rf $TD
mkdir -p $TD $TDY
msgfmt --java --statistics --source -r $CLASS -l $LG -d $TD $i
if [ $? -ne 0 ]
then
echo "ERROR - msgfmt failed on ${i}, not updating translations"
# msgfmt leaves the class file there so the build would work the next time
find build/obj -name messages_${LG}.class -exec rm -f {} \;
RC=1
break
fi
mv $TDX/messages_$LG.java $TDY
rm -rf $TD
fi
fi
done
Expand Down
2 changes: 1 addition & 1 deletion src/syndie/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ public class Version {
/**
* for example "1.102b-1"
*/
public static final String VERSION = "1.105b-0";
public static final String VERSION = "1.106b-1";
}
2 changes: 1 addition & 1 deletion src/syndie/gui/TranslationRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class TranslationRegistry {
* order not important, UI will sort
*/
private static final String[] SUPPORTED_TRANSLATIONS = {
"en", "de", "ru", "sv", "es", "fr", "pt", "pl", "ro"
"en", "de", "ru", "sv", "es", "fr", "pt", "pl", "ro", "el", "it", "nl", "pt_BR", "uk", "zh"
};

private static final List<String> AVAILABLE_TRANSLATIONS;
Expand Down

0 comments on commit ce02486

Please sign in to comment.