Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Localisation with Flags?



  • Hi there..
    I've a small Question I couldn't find an answer to..

    The Situation is:
    When I create Labels/Texts with tr(""), I can create a QT Localisation file.
    Within this file, all texts are listed..
    so long, so good..

    Now, I created around 100 different Dialogs.. each one has two or three Buttons with (opt. Apply), OK and Cancel.

    Refreshing the Localisation file.. I now have 100 times "Oak".. 100 times "Cancel".. and over 40 times "Apply"..

    so. more work than necessary..

    Perhaps.. someone can lead me into the correct Direction..

    How can I add a Language Flag.. like..
    %confirm%, %cancel% and %apply%

    so I only have each entry only one time for all Dialogs project wide, instead of hundreds over hundreds of it..?


  • Lifetime Qt Champion

    Use a custom widget for your Dialog buttons like e.g. QDialogButtonBox.
    Or do a search'n'replace in the ts files. Or use QCoreApplication::translate() to translate those strings (only works when you don't use ui files)


Log in to reply