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

Translation question



  • I have a set of language files including myapp.de_DE.qm

    My code for setting the default language currently does:

    QString language = QLocale::system().name();

    and then uses that to build the fileid for QTranslator.load() of myapp.de_DE.qm for a system running in German in Germany.

    However this doesn't work for an Austrian user whose language name is most likely de_AT.

    I'm thinking of using the other variant of QTranslator::load() that accepts a QLocale() as the first parameter, but would like to know what QLocale::uiLanguages() would return on system running Austrian German. Would it include de_DE?

    Thanks
    David



  • Bump anyone know this stuff?


  • Lifetime Qt Champion

    @Perdrix said in Translation question:

    return on system running Austrian German. Would it include de_DE?

    If so I would call it a bug. If you don't want the region specific art, simply replace or remove it.



  • So you are suggesting that I should just have mayapp.de.qm files, and leave off the region?

    I'm quite OK with that - just a matter of understanding what the right thing to do is.
    David


Log in to reply