Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed jgettext bug with header generation.

Fixed gettext2prop bug where untranslated PO strings became empty strings in property files.
  • Loading branch information...
commit 989c85c93a3bc9148e375ecbfd9ebfc0c2a1fe47 1 parent c871c9a
@seanf seanf authored
View
7 ant-gettext/src/main/java/org/fedorahosted/tennera/antgettext/Gettext2PropTask.java
@@ -138,8 +138,11 @@ public void visit(String key, String englishString, String comment,
String msgid = englishString;
String msgctxt = key;
Message message = cat.locateMessage(msgctxt, msgid);
- if (message != null && !message.isFuzzy())
- properties.setProperty(key, message.getMsgstr());
+ if (message != null && !message.isFuzzy() ) {
+ String msgstr = message.getMsgstr();
+ if (msgstr != null && msgstr.length() != 0)
+ properties.setProperty(key, msgstr);
+ }
}
}
View
3  ant-gettext/src/test/java/org/fedorahosted/tennera/antgettext/BuildTest.java
@@ -211,6 +211,9 @@ public void testGettext2Prop() throws Exception {
assertEquals("_cancel_",
loadProps("src/test/resources/taskdefs/gettext2prop_prop/messages2_dummy.properties")
.getProperty("CANCEL_BUTTON"));
+ assertEquals(null,
+ loadProps("src/test/resources/taskdefs/gettext2prop_prop/messages1_dummy.properties")
+ .getProperty("UNTRANSLATED"));
}
public void testProp2Gettext() throws Exception {
View
3  ant-gettext/src/test/resources/taskdefs/gettext2prop-prop/messages1.properties
@@ -1 +1,2 @@
-ABOUT_BUTTON=About
+ABOUT_BUTTON=About
+UNTRANSLATED=original English text
View
4 ant-gettext/src/test/resources/taskdefs/gettext2prop/dummy.po
@@ -5,3 +5,7 @@ msgstr "_about_"
msgctxt "CANCEL_BUTTON"
msgid "Cancel"
msgstr "_cancel_"
+
+msgctxt "UNTRANSLATED"
+msgid "original English text"
+msgstr ""
View
1  ant-gettext/src/test/resources/taskdefs/prop2gettext-expected/dummy.po
@@ -7,7 +7,6 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-": PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-06 12:12+1000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
View
1  ant-gettext/src/test/resources/taskdefs/prop2gettext-expected/prop2gettext_po.pot
@@ -7,7 +7,6 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-": PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-06 12:12+1000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
View
1  ant-gettext/src/test/resources/taskdefs/prop2po-expected/messages_es.po
@@ -7,7 +7,6 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-": PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-05-01 16:06+1000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
View
2  jgettext/src/main/java/org/fedorahosted/tennera/jgettext/HeaderFields.java
@@ -18,7 +18,7 @@
private Map<String, String> entries = new LinkedHashMap<String, String>();
- public static final String KEY_ProjectIdVersion = "Project-Id-Version: PACKAGE VERSION\n";
+ public static final String KEY_ProjectIdVersion = "Project-Id-Version";
public static final String KEY_ReportMsgidBugsTo = "Report-Msgid-Bugs-To";
public static final String KEY_PotCreationDate = "POT-Creation-Date";
public static final String KEY_PoRevisionDate = "PO-Revision-Date";
View
8 webgettext-example/.classpath
@@ -0,0 +1,8 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/fedorahosted/tennera/webgettext/0.1-SNAPSHOT/webgettext-0.1-SNAPSHOT.jar"/>
+</classpath>
View
24 webgettext-example/.project
@@ -1,12 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>webgettext-example</name>
- <comment></comment>
- <projects>
- <project>webgettext</project>
- </projects>
- <buildSpec>
- </buildSpec>
- <natures>
- </natures>
-</projectDescription>
+ <name>webgettext-example</name>
+ <comment>Umbrella for several Java internationalisation
+ projects</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
5 webgettext-example/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
+#Wed May 06 11:56:40 EST 2009
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
View
21 webgettext/.classpath
@@ -1,10 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/test/java" output="target/test-classes"/>
+ <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/javax/el/el-api/1.0/el-api-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar" sourcepath="M2_REPO/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1.jar" sourcepath="M2_REPO/javax/servlet/jsp/jsp-api/2.1/jsp-api-2.1-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.5/junit-4.5.jar" sourcepath="M2_REPO/junit/junit/4.5/junit-4.5-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
+</classpath>
View
36 webgettext/.project
@@ -1,23 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>webgettext</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
+ <name>webgettext</name>
+ <comment>Tennera WebGettext supports multi-lingual messages in JSP web applications. It includes a custom EL resolver for ResourceBundles, and can be used with Tennera Ant-Gettext to extract English strings from source JSPs into Gettext POT files.
+
+offers lookups of localised strings using an EL resolver for ResourceBundle</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Please sign in to comment.
Something went wrong with that request. Please try again.