Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to enter translatable text using plural/arguments in QtDesigner?

How to enter translatable text using plural/arguments in QtDesigner?

Scheduled Pinned Locked Moved Qt Creator and other tools
qtdesignertranslator
1 Posts 1 Posters 800 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on 22 Sept 2015, 12:10 last edited by
    #1

    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

    1 Reply Last reply
    0

    1/1

    22 Sept 2015, 12:10

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved