[Qt-qml] QML, qsTr() and variable substitution

Juha Turunen turunen at iki.fi
Thu Oct 6 11:23:47 CEST 2011


On Thu, Oct 6, 2011 at 12:19 PM, Artem Marchenko
<artem.marchenko at gmail.com> wrote:

> How do you do the same in QML?
> There is no standard way for templating JavaScript strings and to my
> understanding Qt doesn't recommend any specific library for it. The what do
> you do for QML localization?
> Or is JavaScript's qsTr() is somehow able to care after the arguments on its
> own?

var dateHeader = qsTr("Downloading file %1 of
%2").arg(fileNumber()).arg(totalNumberOfFiles())
(from http://sf2011.meego.com/sites/all/files/slides/meego-localization_0.pdf)

Juha


More information about the Qt-qml mailing list