Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Help with what should i include for translation at my app.
Qt 6.12 LTS is out! See what's new in the release blog

Help with what should i include for translation at my app.

Scheduled Pinned Locked Moved General and Desktop
15 Posts 3 Posters 8.8k Views 1 Watching
  • 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.
  • EddyE Offline
    EddyE Offline
    Eddy
    wrote on last edited by
    #2
    1. just don't translate buttongroup if you don't see it in your program.

    2. try using the arg function on your html code string

    3. IANAL but in my opinion the licence should not be translated. Have a look at the GPGL website for instance. Several people have translated it, but the english version says it's the only official one.

    Qt Certified Specialist
    www.edalsolutions.be

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Leon
      wrote on last edited by
      #3
      1. I don't want to ignore it.. Can't i somehow disable it to be translatable?

      2. What exactly do you mean?
        @<a href="http://www.wallch.t35.com/"><span>.<arg>WebSite</arg></span></a>@
        ?

      3. Ok thanks

      4. Should i translate this when showing a dialog? @tr("%1 Files (.%2);;All Files ()")@

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alexandr Ekimov
        wrote on last edited by
        #4
        1. You don't want to translate, don't want to ignore. What do you want? :)
        2. QString::arg()
        3. Why not?

        Ekimov Alexander,
        http://www.ekimoff.com

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Leon
          wrote on last edited by
          #5

          1 Eddy said to me not to translate it. So basically ignore it. I don't want to ignore it.. I just don't want to be translatable.
          2.Something like this?
          @ui->label_5->setText(QString::arg("<a href="http://www.wallch.t35.com/"><span>WebSite</span></a>"));
          @
          Which of course doesn't work..
          4.Ok

          1 Reply Last reply
          0
          • EddyE Offline
            EddyE Offline
            Eddy
            wrote on last edited by
            #6
            1. try this. it works for me.

            EDIT :
            QString www("website");

            QString str = QString("
            <
            a
            href

            "http://www.google.com/"><span>%1</span></a>").arg(www);

            EDIT : now you can use it like this
            ui->label_5->setText(str);

            Hint : mention the " to get it as one string including " characters

            PS : i've put the solution one character per line to avoid the editor hiding the details. So just put them on one line and go!

            Qt Certified Specialist
            www.edalsolutions.be

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Alexandr Ekimov
              wrote on last edited by
              #7
              1. @QString site = QString("Bla %1 bla").arg(tr("Website"))@

              P.S. All it contains in the documentation.

              Ekimov Alexander,
              http://www.ekimoff.com

              1 Reply Last reply
              0
              • L Offline
                L Offline
                Leon
                wrote on last edited by
                #8

                I added an orange color too.

                @QString str = QString("<a ><span font-family:'Sans'; font-size:10pt; text-decoration: underline; color:#ff5500;"<span>%1</span></a>").arg(tr("Website"));
                ui->label_5->setText(str);@

                The editor hides some things as Eddy said..

                EDIT:
                Another Question:
                What about "this":http://img38.imageshack.us/img38/3739/screenshot1lh.png?
                I don't think i should do it the same way, :/

                1 Reply Last reply
                0
                • EddyE Offline
                  EddyE Offline
                  Eddy
                  wrote on last edited by
                  #9

                  Hi Leon,

                  I don't understand your question you added by EDIT.

                  What do you want exactly?

                  Maybe it's better to ask in another topic if it's another specific question?

                  Qt Certified Specialist
                  www.edalsolutions.be

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    Leon
                    wrote on last edited by
                    #10

                    Ok i will..

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      Leon
                      wrote on last edited by
                      #11

                      I found solution for 1.

                      <attribute name="buttonGroup">
                      <string>mybuttongroup</string>
                      </attribute>

                      This string needs the notr="true" flag so it doesn't appear in Linguist :)

                      1 Reply Last reply
                      0
                      • EddyE Offline
                        EddyE Offline
                        Eddy
                        wrote on last edited by
                        #12

                        Good for you!

                        Thanks for sharing, but could you use several lines like i did. I think some of the code has dissapeared because the editor interprets it.

                        Qt Certified Specialist
                        www.edalsolutions.be

                        1 Reply Last reply
                        0
                        • L Offline
                          L Offline
                          Leon
                          wrote on last edited by
                          #13

                          No i just checked it and nothing has disappeared :)

                          1 Reply Last reply
                          0
                          • EddyE Offline
                            EddyE Offline
                            Eddy
                            wrote on last edited by
                            #14

                            Ok thanks,

                            I asked because i didn't see a not true flag.

                            Qt Certified Specialist
                            www.edalsolutions.be

                            1 Reply Last reply
                            0
                            • L Offline
                              L Offline
                              Leon
                              wrote on last edited by
                              #15

                              Using the arg function with tr() i see that at qt linquist i see the %1%2 part...
                              Is it a problem?
                              Is there a way not be able to see %1%2?

                              EDIT: What about dots and "!"?
                              EDIT2: What about unicode text? How can this be translatable? I mean something like this:
                              @QString::fromUtf8("and it will change every ½ hour")@

                              1 Reply Last reply
                              0

                              • Login

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