This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new db47aa4  Skip untranslated values on import
db47aa4 is described below

commit db47aa425f5c63548f9c7fc8926a546b6798df2f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri May 1 10:41:06 2020 +0100

    Skip untranslated values on import
    
    This simplifies the export from POEditor.com as the default export is
    for translated and untranslated values.
---
 java/org/apache/tomcat/buildutil/translate/Import.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/buildutil/translate/Import.java 
b/java/org/apache/tomcat/buildutil/translate/Import.java
index b471f8c..3733248 100644
--- a/java/org/apache/tomcat/buildutil/translate/Import.java
+++ b/java/org/apache/tomcat/buildutil/translate/Import.java
@@ -55,6 +55,11 @@ public class Import {
 
         for (Object objKey : objKeys) {
             String key = (String) objKey;
+            String value = props.getProperty(key);
+            // Skip untranslated values
+            if (value.trim().length() == 0) {
+                continue;
+            }
             CompositeKey cKey = new CompositeKey(key);
 
             if (!cKey.pkg.equals(currentPkg)) {
@@ -73,7 +78,7 @@ public class Import {
                 w.write(System.lineSeparator());
             }
 
-            w.write(cKey.key + "=" + 
Utils.formatValue(props.getProperty(key)));
+            w.write(cKey.key + "=" + Utils.formatValue(value));
             w.write(System.lineSeparator());
         }
         if (w != null) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to