Skip to content

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented Jun 4, 2021

It appears that conversion from XLIFF format to Qt's TS is not enough for correct update translation files in the main repo.

The problem is that the approved attributes of the <trans-unit> tags of XLIFF translation files fetched from Transifex do not follow the actual status of a messages: neither "translated:yes/no", nor "reviewed:yes/no".

Every new translatable message in the code, after make translate ends in the bitcoin_en.ts with an empty element

<translation type="unfinished"></translation>

and in the bitcoin_en.xlf without approved="yes".

And those attributes--type="unfinished" and absence of approved="yes"--are inherited by the fetched XLIFF translation files and the converted TS files.

Ignoring the type="unfinished" attribute seems the easiest way to cope with this issue.

@hebasto
Copy link
Member Author

hebasto commented Jun 4, 2021

bitcoin/bitcoin#22151 could give additional input.

@laanwj
Copy link
Member

laanwj commented Jun 7, 2021

Concept ACK.

I'm a little bit unhappy about how much extra pre- and post-processing needed to use XLIFF. Apart from the translator comments it was working fine with .ts. This makes the pipeline even more complex and difficult to troubleshoot. Then again there is no way back now, at least for 0.22.

Is this still compatible with releases that have .ts translations? It might still be necessary to do imports for 0.21.x releases. Or should we use an old copy of the script for that. Also fine with me.

@hebasto
Copy link
Member Author

hebasto commented Jun 7, 2021

I'm a little bit unhappy about how much extra pre- and post-processing needed to use XLIFF.

Yeah, the additional steps, besides just lconvert calls, are unexpected. OTOH, there is a possibility to drop (now) intermediate TS files. Of course, such a change should wait until TS files support goes out from our time horizon.

Is this still compatible with releases that have .ts translations?

Yes. That is one of this PR goals to keep 100% compatibility with TS translation files.

@hebasto
Copy link
Member Author

hebasto commented Jul 21, 2021

Rebased due to the merging of #102.

@laanwj
Copy link
Member

laanwj commented Jul 21, 2021

Tested ACK 2fcdb51

The only difference I see in the .ts files afterwards is that every single message now has status unfinished. While this generates a huge diff, it doesn't seem that the status affects Qt's use of the message. E.g.:

     <message>
         <source>Right-click to edit address or label</source>
-        <translation>Rechtermuisklik om het adres of label te wijzigen</translation>
+        <translation type="unfinished">Rechtermuisklik om adres of label te wijzigen</translation>
     </message>

@laanwj laanwj merged commit efbd3a7 into bitcoin-core:master Jul 21, 2021
@hebasto hebasto deleted the 210604-xliff branch July 21, 2021 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants