qmake translations doesn't seem to work

Posted by gordebak on Stack Overflow See other posts from Stack Overflow or by gordebak
Published on 2012-11-11T10:50:36Z Indexed on 2012/11/11 11:00 UTC
Read the original article Hit count: 197

Filed under:
|
|

I have a Qt app with a Czech translation. I can get my translation compiled and installed fine with the following code. But when I run the app, translation doesn't work. What am I missing?

I even tried to chmod 644 to change the permissions of the translation file, but it didn't work either.

Thanks in advance.

TRANSLATIONS += cs_CZ.ts

isEmpty(QMAKE_LRELEASE) {
   win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
   else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
   unix {
       !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 }
   } else {
       !exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
   }
}

updateqm.input = TRANSLATIONS
updateqm.output = qm/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE -silent ${QMAKE_FILE_IN} -q qm/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += updateqm

INSTALLS += translations

translations.path = /usr/share/app
translations.files = qm/cs_CZ.qm

© Stack Overflow or respective owner

Related posts about translation

Related posts about locale