Translation using XLIFF file #287

issue hebasto openend this issue on April 21, 2021
  1. hebasto commented at 7:15 pm on April 21, 2021: member

    TL;DR

    1. Use Qt Translator Comments to annotate tr() calls
    2. Do not use disambiguation strings in tr() calls, except in item 3
    3. If two or more identical strings have different meanings and could be translated in different ways, use disambiguation strings

    Since https://github.com/bitcoin/bitcoin/pull/21694 is merged there is an opportunity for developers to provide an exhaustive context for translatable strings to translators who are working via the Transifex.

    Strings in Qt code

    Using a Qt TS translation file (pre-21694), v0.21.x and earlier: DeepinScreenshot_select-area_20210421165407

    Using a XLIFF translation file (post-21694), v22.x: DeepinScreenshot_select-area_20210421165641

    The added “DEVELOPER NOTES” are the main means to provide context to translators in the Transifex editor. See:

    To provide such notes in C++ code developers must use Qt Translator Comments that annotate tr() calls: https://github.com/bitcoin-core/gui/blob/e16f8720dca2de1040478968c9f3ca07644a04b7/src/qt/addressbookpage.cpp#L298-L299

    Please note, that despite documented support for <context-group> and <context> XML elements of XLIFF file by Transifex, disambiguation strings, i.e., the second argument of tr() call, are not rendered in Transifex editor. Therefore, they add no value to translation process.

    Another change is “Context” in the “More Info” tab: a class name (the default context for tr() calls) is replaced with a source file name. Therefore, if knowing a class name is valuable to translators, developers must provide it in translator comments.

    Strings in non-Qt code

    The only change is “Context” in the “More Info” tab: instead of “bitcoin-core” the bitcoinstrings.cpp file is mentioned.

    Handling plural forms

    Seems everything works fine. Details:

  2. hebasto added the label Translations on Apr 21, 2021
  3. laanwj commented at 7:31 pm on April 21, 2021: member
    Concept ACK, thanks for working on this!
  4. hebasto added the label Brainstorming on Apr 21, 2021
  5. hebasto removed the label Brainstorming on Aug 4, 2021
  6. hebasto added the label Doc on Aug 4, 2021

github-metadata-mirror

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

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