[Interest] Fw: Translations in QML

Gianluca gmaxera at gmail.com
Wed Jul 13 08:47:43 CEST 2016


QLinguist has an option to guess the translation of other string on the basis of current translated ones. That means, if you have 100 places where you wrote tr(“Hello”) and in QLinguist you translate only one of those, you can ask to QLinguist to translate all the others automatically.
But, it’s better that you avoid to write 100 times tr(“Hello”) if it has to be translated always to the same string.

So, my suggestion is that you use variables to have only one tr(“Hello”) in all your code:

property string hello: tr(“Hello”)

in that way there will be only one tr(“Hello”) to translate.


Il giorno 05/lug/2016, alle ore 06:34, Beemaneni, Bala <bala.beemaneni at thermofisher.com> ha scritto:

> From: Beemaneni, Bala
> Sent: Tuesday, July 5, 2016 11:03 AM
> To: development at qt-project.org
> Subject: Translations in QML
> Hi Guyz,
> I am using Translations in Qml with linguist ,lupdate and lrelease.It works fine. But my requirement is , when i have a string say "Hello" in different QML files say 100 places , i do not want to update the respective language string for that in each file.Hence the update should be done in one place so that it reflects everywhere.Currently i do not have much idea how to achieve this? Can anyone suggest the best approach ...
> Warm Regards
> Bala B
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160713/6099edbd/attachment.html>

More information about the Interest mailing list