translation: Provide more context to Transifex translators #21465

issue hebasto openend this issue on March 18, 2021
  1. hebasto commented at 0:10 am on March 18, 2021: member

    The Problem

    Using native Qt translation files (TS, *.ts) for exchanging with Transifex platform limits means to provide context to translators to the only category:

    C++ source code TS XML element Transifex metadata
    Class Name <name>ClassName</name> Context
    disambiguation parameter of tr() function <comment>Short comment</comment> N/A
    Translator Comments //: ... <extracomment>Nice comment.</extracomment> N/A

    More details:

    The Solution

    XLIFF file format is supported by Transifex much better.

    And Qt provides us with a stand-alone conversion tool lconvert.

    0$ lconvert -o bitcoin_es.xlf -i bitcoin_en.ts
    

    Now more context options are available:

    TS XML element XLIFF XML element Transifex metadata
    <name>ClassName</name> <group resname="ClassName"></group> yes
    <comment>Short comment</comment> <context>Short comment</context> yes
    <extracomment>Nice comment.</extracomment> <note from="developer">Nice comment.</note> yes

    More details:


    Looking for Concept (N)ACKs.

  2. hebasto added the label Brainstorming on Mar 18, 2021
  3. hebasto added the label Docs on Mar 18, 2021
  4. jarolrod commented at 5:38 pm on March 18, 2021: member

    Concept ACK

    So our disambiguation strings don’t end up on transifex to provide context? Why do we have them? If they don’t show up on transifex then they serve no purpose for the Translators.

    Following from your chart it seems that the development flow wouldn’t involve too much overhead/change from what we have now. It seems that migrating to the XLIFF files, the C++ disambiguation strings will show up as <comment> in the TS XML Element which would then show up on Transifex. This is a huge benefit to translators.

  5. hebasto commented at 6:03 pm on March 18, 2021: member

    So our disambiguation strings don’t end up on transifex to provide context?

    Yes, for now.

    Why do we have them? If they don’t show up on transifex then they serve no purpose for the Translators.

    I did not check the whole code base, but it seems https://github.com/bitcoin-core/gui/pull/220 was the first usage of them. Translation file (*.ts) could be downloaded from Transifex by a translator to work on it locally using Qt Linguist tool. Then the translated file could be uploaded to Transifex back.

  6. laanwj commented at 1:34 pm on March 19, 2021: member

    Concept ACK if it helps translators.

    I think the only code change necessary here to use the new format would be to add lconvert step to make translate, and check in the resulting bitcoin_en.xlf file for Transifex to pick up. That only affects the English (base) translation.

    This assumes that we still get back .ts files when pulling translations with the transifex-migrate-resource.py script. If not, that script too will need to be adapted (to convert back to .ts for Qt usage).

    Translation file (*.ts) could be downloaded from Transifex by a translator to work on it locally using Qt Linguist tool. Then the translated file could be uploaded to Transifex back.

    It’s possible, though this might lose the metadata (who translated what), as well as prevents people from collaborative editing of the same language. I do not think it would be good to recommend it.

  7. hebasto commented at 1:40 pm on March 19, 2021: member

    Translation file (*.ts) could be downloaded from Transifex by a translator to work on it locally using Qt Linguist tool. Then the translated file could be uploaded to Transifex back.

    It’s possible, though this might lose the metadata (who translated what), as well as prevents people from collaborative editing of the same language. I do not think it would be good to recommend it.

    I agree with your latter statement. I mentioned that option only for a reason to show how the additional context means could be used right now.

  8. hebasto commented at 1:42 pm on March 19, 2021: member

    @laanwj

    Concept ACK if it helps translators.

    My concerns are about how to test this approach without breaking anything.

  9. laanwj commented at 1:52 pm on March 19, 2021: member

    My concerns are about how to test this approach without breaking anything.

    We could create 22.0 translations early and test with that. If it breaks now, not too bad, still a lot of time to start over.

  10. hebasto commented at 12:31 pm on April 15, 2021: member

    @laanwj

    We could create 22.0 translations early and test with that.

    See #21694.

  11. laanwj closed this on Apr 20, 2021

  12. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me