Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QUiLoader and internationalization
Qt 6.11 is out! See what's new in the release blog

QUiLoader and internationalization

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.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.
  • E Offline
    E Offline
    Exotic_Devel
    wrote on last edited by
    #1

    Is it possible implement internationalization in an application based on QUiLoader?

    I ask this because according to the documentation there must a file with Qt code for using lupdate.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Qt cannot translate a file without there being translations for that file, of course. I assume you want to offer the .ui file dynamically from somewhere. Perhaps you can also offer a .qm file with translations with it?

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Exotic_Devel
        wrote on last edited by
        #3

        Yes, my application is full dynamic ui, not exists header or sources for widgets, everything works on QUiLoader.

        However, all of the strings of widgets are marked for translation in ui file

        !http://i59.tinypic.com/2uz5y7p.png(Screen)!

        How to use lupdate this case where everything is dynamic and there are no sources or header of widgets?

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Exotic_Devel
          wrote on last edited by
          #4

          The question was whether lupdate is able to generate the ts files only from ui files.
          According to a response obtained in another forum, yes, lupdate reads the ui files.

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Exotic_Devel
            wrote on last edited by
            #5

            Lupdate tested via command line and it worked:

            @lupdate connecdialog.ui -ts connecdialog.ts@

            But when running through the Qt Creator I get the message

            @Starting external tool '/opt/Qt/5.3/gcc_64/bin/lupdate' /home/matheus/Dropbox/Projetos/Freedom/TecTracker/TecTracker.pro
            lupdate warning: no TS files specified. Only diagnostics will be produced for '/home/matheus/Dropbox/Projetos/Freedom/TecTracker/TecTracker.pro'.

            Updating 'Core/gui/uis/core_connecdialog_ptBr.ts'...
            Found 0 source text(s) (0 new and 0 already existing)

            '/opt/Qt/5.3/gcc_64/bin/lupdate' finished
            @

            The TS file is created but I see the message that he found nothing to translate.

            @Updating 'Core/gui/uis/core_connecdialog_ptBr.ts'...
            Found 0 source text(s) (0 new and 0 already existing)@

            My project is partitioned in subdirs:

            !http://i57.tinypic.com/wlsojm.png(Screen)!

            What am I doing wrong?

            1 Reply Last reply
            0
            • E Offline
              E Offline
              Exotic_Devel
              wrote on last edited by
              #6

              lupdate not find the ui file, because I do not use the FORMS variable in my pro file.
              I do not use FORMS because my application is all based in QUiLoader, so I do not need the headers that are generated by FORMS variable during compilation.
              So I use OTHER_FILES and not FORMS.

              Is there any way around this? Or at least prevent headers are generated from the variable FORMS?

              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 Extensions
              • Unsolved