Skip to content

Translation using XLIFF file #287

Open
@hebasto

Description

@hebasto

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 bitcoin/bitcoin#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:

//: %1 is a name of the file (e.g., "addrbook.csv") that the bitcoin addresses were exported to.
tr("There was an error trying to save the address list to %1. Please try again.", "An error message.").arg(filename));

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions