PDA

View Full Version : Qt5's own translation gets loaded only half-way through.



Zalewa
15th August 2015, 13:14
Hi. Just to be clear, I'm talking here about loading .qm files that come with Qt installation. In this case it's qt_pl.qm.

My program loads the translation by first loading Qt's own translation, then its own translation and then translation of its plugins. This system has worked perfectly in Qt4 and I was getting all strings in my program translated.

With Qt5 it's no longer the case. While my own translations get loaded properly, translations for Qt5 only work in several places and the rest remains English. I've compared two Qt5 versions: 5.4.1 and 5.2.1. Problem is present in both of them, although different strings get or don't get loaded in each version. I can also compile the same code with Qt 4.8.6 where there's no problem. Here's a video showcasing all of this exactly:


https://www.youtube.com/watch?v=dByHVUbFtuc&feature=youtu.be

The starting procedure of my application up until the translation gets loaded looks like this:


Interpret command line arguments (this is a no-op if there are no arguments).
Instantiate QApplication.
Load plugins DLLs (I tried deleting all plugins, to no avail, therefore plugins don't break anything).
Load main config (uses QSettings).
Install translations.


Was there any change between Qt4 and Qt5 to how the translation files should be loaded?