translate / pootle

Online translation tool
http://pootle.translatehouse.org
GNU General Public License v3.0
1.49k stars 288 forks source link

Pootle doesn't include translated xliff target values when doing pootle_fs sync #6804

Open boite opened 6 years ago

boite commented 6 years ago

Steps to reproduce

  1. Create a project that uses xliff and git and which has a templates xliff and target language xliff
  2. pootle fs fetch myproject
  3. pootle fs add myproject
  4. pootle fs sync myproject
  5. translate, translate, translate
  6. pootle fs resolve --pootle-wins myproject
  7. pootle fs sync myproject

Results

After doing steps 6 and 7:-

$ pootle fs resolve --pootle-wins myproject
Staged for merge (Pootle Wins) (1)
----------------------------------
Files or Stores staged for merge where the corresponding file/Store has also been updated or created

  /en/myproject/codelist-AB0BloodGroup.xlf
   <-->  /l10n/codelist-AB0BloodGroup.en.xlf

$ pootle fs sync myproject
2018-02-07 15:55:03,507 INFO Pushing to remote git branch (myproject --> git@github.com:boite/myproject.git): 05ab3cd44dd04d9abbdb8ed7eda29b3b
Merged from pootle (1)
----------------------
Merged - Pootle won where unit updates conflicted

  /en/myproject/codelist-AB0BloodGroup.xlf
   <-->  /l10n/codelist-AB0BloodGroup.en.xlf

It is expected that the english translations of the dutch strings will be present in codelist-AB0BloodGroup.en.xlf, but:-

$ git show
commit c723324c7e9ed1767dcc91dc0e5f7df558d81827 (HEAD -> master, origin/master, origin/HEAD)
Author: boite <xxxxxxxxxxxxxxxxxxx>
Date:   Wed Feb 7 15:54:57 2018 +0000

    Translation files updated from Pootle

diff --git a/l10n/codelist-AB0BloodGroup.en.xlf b/l10n/codelist-AB0BloodGroup.en.xlf
index caf7bc4..247168a 100644
--- a/l10n/codelist-AB0BloodGroup.en.xlf
+++ b/l10n/codelist-AB0BloodGroup.en.xlf
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version='1.0' encoding='UTF-8'?>
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
   <file source-language="nl_NL" datatype="xml" original="myproject.xml" target-language="en">
     <body>
       <trans-unit id="codelist:AB0BloodGroup;item:112144000;property:name" resname="name">
         <source>A</source>
-        <target></target>
+        <target/>
         <note from="developer"><![CDATA[The "name" property of the item with code "112144000" and display name "Blood group A (finding)" from the codelist with ID "AB0BloodGroup".]]></note>
       </trans-unit>
       <trans-unit id="codelist:AB0BloodGroup;item:112149005;property:name" resname="name">
         <source>B</source>
-        <target></target>
+        <target/>
         <note from="developer"><![CDATA[The "name" property of the item with code "112149005" and display name "Blood group B (finding)" from the codelist with ID "AB0BloodGroup".]]></note>
       </trans-unit>
       <trans-unit id="codelist:AB0BloodGroup;item:165743006;property:name" resname="name">
         <source>AB</source>
-        <target></target>
+        <target/>
         <note from="developer"><![CDATA[The "name" property of the item with code "165743006" and display name "Blood group AB (finding)" from the codelist with ID "AB0BloodGroup".]]></note>
       </trans-unit>
       <trans-unit id="codelist:AB0BloodGroup;item:58460004;property:name" resname="name">
         <source>0</source>
-        <target></target>
+        <target/>
         <note from="developer"><![CDATA[The "name" property of the item with code "58460004" and display name "Blood group O (finding)" from the codelist with ID "AB0BloodGroup".]]></note>
       </trans-unit>
       <trans-unit id="codelist:AB0BloodGroup;item:UNK;property:name" resname="name">
         <source>Onbekend</source>
-        <target></target>
+        <target/>
         <note from="developer"><![CDATA[The "name" property of the item with code "UNK" and display name "Onbekend" from the codelist with ID "AB0BloodGroup".]]></note>
       </trans-unit>
       <trans-unit id="codelist:AB0BloodGroup;item:NI;property:name" resname="name">
         <source>Geen informatie</source>
-        <target></target>
+        <target/>
         <note from="developer"><![CDATA[The "name" property of the item with code "NI" and display name "Geen informatie" from the codelist with ID "AB0BloodGroup".]]></note>
       </trans-unit>
     </body>

Environment

$ pootle --version
Pootle 2.9.0rc1 (Django 1.10.8, Translate Toolkit 2.2.5)
boite commented 6 years ago

Perhaps relevant is that, after doing the translations in step 5, fs state reports a conflict in the translated file, even though the filesystem version hasn't changed:-

$ pootle fs state myproject
Conflicts (1)
-------------
Both Pootle Store and file in filesystem have changed

  /en/myproject/codelist-AB0BloodGroup.xlf
   <-->  /l10n/codelist-AB0BloodGroup.en.xlf

and, weirdly, it reports the same conflicted state after resolving and syncing (steps 6 and 7).