How to enter translatable text using plural/arguments in QtDesigner?
-
Hello to all,
I got a question concerning the input of translatable texts in QtDesigner:
I use the "Design" area of "QtCreator" to place some labels on a widget and want to make the labels translatable.in the code I use e.g.
ui->label_6->setText(tr("%n measurement(s) saved", 0, n));
or
ui->label_n->setText(QString::number(n));
with n being an int.
Is it possible to insert something like this also via the Designer?
Also, is there a possibility to use translator arguments with the Designer?
So far I have only found the properties "translatable", "disambiguation" and "comment" in the property window.The reason behind my questions is the following:
I create labels and buttons on a "page" widget and want to switch the language dynamically using the translator. Setting the text of the widgets via code directly works fine, but after switching the language the retranslateUi(); function in my overloaded changeEvent function takes the text from that has been defined in the Designer and I need to update the texts of the labels "manually" in the code. Thus, I wanted to know whether there is a more "direct" way to do this.Kind regards,
Markus