From 47391678e7bc130cfc6d5fb76337b4ef81a64b8d Mon Sep 17 00:00:00 2001
From: reger <reger18@arcor.de>
Date: Sun, 4 Sep 2016 01:00:28 +0200
Subject: [PATCH] TranslationNews: take out limitation to send only one text
 per translated file (to avoid need of repeated publish button hits)

---
 htroot/TransNews_p.java | 26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)

diff --git a/htroot/TransNews_p.java b/htroot/TransNews_p.java
index 5a2ab53aa..468d92adc 100644
--- a/htroot/TransNews_p.java
+++ b/htroot/TransNews_p.java
@@ -42,7 +42,6 @@ import net.yacy.server.serverObjects;
 import net.yacy.server.serverSwitch;
 import net.yacy.utils.crypt;
 import net.yacy.utils.translation.TranslationManager;
-import net.yacy.utils.translation.TranslatorXliff;
 
 public class TransNews_p {
 
@@ -90,32 +89,13 @@ public class TransNews_p {
                                 continue;
                             }
                             if (NewsPool.CATEGORY_TRANSLATION_ADD.equals(rtmp.category())) {
-                                //String tmplng = rtmp.attribute("language", null);
+                                String tmplng = rtmp.attribute("language", null);
                                 String tmpfile = rtmp.attribute("file", null);
                                 String tmpsource = rtmp.attribute("source", null);
-                                String tmptarget = rtmp.attribute("target", null);
+                                //String tmptarget = rtmp.attribute("target", null);
 
-                                if (sb.peers.mySeed().hash.equals(rtmp.originator())) {
-                                    /*
-                                        if (tmplng != null && tmplng.equals(currentlang)) {
-                                            sendit = false;
-                                            break;
-                                        }*/
-                                    if (tmpfile != null && tmpfile.equals(file)) {
-                                        sendit = false;
-                                        break;
-                                    }
-                                    if (tmpsource != null && tmpsource.equals(sourcetxt)) {
-                                        sendit = false;
-                                        break;
-                                    }
-                                    if (tmptarget != null && tmptarget.equals(targettxt)) {
-                                        sendit = false;
-                                        break;
-                                    }
-                                }
                                 // if news with file and source exist (maybe from other peer) - skip sending another msg (to avoid confusion)
-                                if ((tmpfile != null && tmpfile.equals(file))
+                                if ((tmplng != null && tmplng.equals(currentlang)) && (tmpfile != null && tmpfile.equals(file))
                                         && (tmpsource != null && tmpsource.equals(sourcetxt))) {
                                     sendit = false;
                                     break;