[Localization] {1 %} appears in the translation strings

Riitta-Leena Miettinen Riitta-Leena.Miettinen at qt.io
Wed Jul 4 09:29:22 CEST 2018


Those are placeholders for text, such as filenames, that is automatically inserted by the application when the application is running. You cannot get rid of them, and you should actually always try to figure out what will appear in their place, so that you can put them in the correct place in your translated text.

>From the Qt Linguist Manual:

Handling Numbered Arguments and Plurals

Some phrases contain numbered arguments. A numbered argument is a placeholder that will be replaced with text at run-time. A numbered argument appears in a source string as a percent sign followed by a digit. Consider an example: After processing file %1, file %2 is next in line. In this string to be translated, %1 and %2 are numbered arguments. At run-time, %1 and %2 will be replaced with the first and second file names respectively. The same numbered arguments must appear in the translation, but not necessarily in the same order. A German translation of the string might reverse the phrases, for example Datei %2 wird bearbeitet, wenn Datei %1 fertig ist. Both numbered arguments appear in the translation, but in the reverse order. %i will always be replaced by the same text in the translation strings, regardless of where argument i appears in the argument sequence in the source string.

The use of numbered arguments is often accompanied by the use of plurals in the source text. In many languages, the form of the text will depend on the value shown, and more than one translation is required. If the developers have marked up the source text in correct way, fields for each of the possible plural forms will be available in the translation area. For more information, see Writing Source Code for Translation<https://doc.qt.io/qt-5/i18n-source-translation.html#handling-plurals>.




Leena Miettinen
Sr. Documentation Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
riitta-leena.miettinen at qt.io

Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B

From: scootergrisen<mailto:scootergrisen at gmail.com>
Sent: Mittwoch, 4. Juli 2018 00:06
To: localization at qt-project.org<mailto:localization at qt-project.org>
Subject: [Localization] {1 %} appears in the translation strings

Each time i update a translation to a new version i see a few {1 %} or
whatever it is.

Why are they there?

And how can we make them not appear and change the translation strings?
Localization mailing list
Localization at qt-project.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/localization/attachments/20180704/bdb64b9d/attachment.html>

More information about the Localization mailing list