translate / pootle

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

XLIFF implementation expects certain states which might not match input XLIFF #6607

Open JohnnyKing94 opened 7 years ago

JohnnyKing94 commented 7 years ago

Steps to reproduce:

Pootle 2.8.0rc7 (and I think it was the same with rc6, i just didn't notice) syncs all my files in a wrong way when i run pootle sync_stores --force. This is my sample file which you can make tests with it: https://www.dropbox.com/s/o9lzdzbhojap37y/gamedata_1.xliff?dl=0 What you can see overall, it is a file with some target having in some cases the state attributes and in others not, same for trans-unit with the approved tags.

Where these attributes appear, it's related to the fact I was running Pootle 2.8.0rc3 and the tags always have been applied in all my files via pootle sync_stores --force, now no more!

Results (Expected/Actual):

In the previous version of Pootle the file was perfectly compiled showing all the cases where a string was in <target state="needs-translation"> and <trans-unit approved="no" when a string on Pootle was in needs-revision OR in <target state="translated"> and <trans-unit approved="yes" when a string was actually translated on Pootle.

For example the first string you see on the file is actually in need-revision state on my Pootle server (https://translate.tamrielunlimited.it/projects/gamedata/translate/gamedata_1.xliff#search=3427285-0-3&sfields=locations), but the file shows this, which it is wrong

      <trans-unit xml:space="preserve" id="3427285-0-3">
        <source>IDLE</source>
        <target>IDLE</target>
      </trans-unit>

The expected result must be

      <trans-unit xml:space="preserve" approved="no" id="3427285-0-3">
        <source>IDLE</source>
        <target state="needs-translation">IDLE</target>
      </trans-unit>

Basically the only diff is the two attributes missing...

Environment (i.e. 'pootle --version', DB, OS, Browser):

OS: Ubuntu Linux 16.04.1 LTS pootle --version: Pootle 2.8.0rc7 (Django 1.10.7, Translate Toolkit 2.2.4) MySQL: 5.7.19 Browser: Firefox 54.0.1

dwaynebailey commented 7 years ago

OK so I've tested an example file with every single possible permutation of state change. I then ran sync_stores with no other options. All operate as expected in 2.8.0rc7 except the following:

So summary for these examples:

  1. The target is set correctly
  2. The states remain as they were set previously
JohnnyKing94 commented 7 years ago

@dwaynebailey, did you test it with the example i gave? If not, can you please do that... thx