You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/05/01 09:42:31 UTC

[tomcat] branch 9.0.x updated: Skip untranslated values on import

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

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


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

commit 234c0e364a48f6ac8f859ad0a6c5561858d18de9
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org