Important: Please read the Qt Code of Conduct -

QUiLoader and internationalization

  • 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.

  • 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?

  • 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


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

  • 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.

  • 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/
    lupdate warning: no TS files specified. Only diagnostics will be produced for '/home/matheus/Dropbox/Projetos/Freedom/TecTracker/'.

    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:


    What am I doing wrong?

  • 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?

Log in to reply