nmantelier
6th January 2017, 13:05
Hello,
I need to translate a program via QT translate.
And I am looking a way to use ID instead of source message. But to keep source message as default value if ID was not find in translator.
Something like:
tr("ID_145587","This is default string")
If ID_145587 is find by translator we use the translated string else we use "This is default string".
I find a way to do this partialy
//% "This is default string"
QString translated = qtTrId("ID_GUI_1564");
That allow to use "This is default string" if string as not been translate but display "ID_GUI_1564" if no qm loaded.
And i do not find a way to work with string with param like tr("Value string is %1").arg(QString(value))
There is any way to do that i need ?
I need to translate a program via QT translate.
And I am looking a way to use ID instead of source message. But to keep source message as default value if ID was not find in translator.
Something like:
tr("ID_145587","This is default string")
If ID_145587 is find by translator we use the translated string else we use "This is default string".
I find a way to do this partialy
//% "This is default string"
QString translated = qtTrId("ID_GUI_1564");
That allow to use "This is default string" if string as not been translate but display "ID_GUI_1564" if no qm loaded.
And i do not find a way to work with string with param like tr("Value string is %1").arg(QString(value))
There is any way to do that i need ?