Correctly load the Qt-native translations
ClosedPublic

Authored by ltoscano on Feb 25 2017, 9:08 PM.

Details

Summary

ecm_create_qm_loader() uses Q_COREAPP_STARTUP_FUNCTION to inject the
loader of the additiona translator. The macro does not seem to work
when the loader is linked in a separate static library (the code
which uses Qt translations is all inside stepcore).
So call the ECM macro (and then link the special loader) where
the Q(Core)Application is defined.
Many previously untranslated strings are not translated.
Some additional work is needed but it probably depends on the
special structure of stepcore.

Test Plan

The code compiles, and the name of the objects (left pane) and the
properties (part of the right pane) are translated

Diff Detail

Repository
R341 Step
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ltoscano created this revision.Feb 25 2017, 9:08 PM
ltoscano added a project: KDE Edu.
ltoscano added a subscriber: KDE Edu.
aacid accepted this revision.Feb 25 2017, 10:07 PM
aacid added a subscriber: aacid.

Static library meh

This revision is now accepted and ready to land.Feb 25 2017, 10:07 PM

I tried also a patch which converts stepcore into a proper .so while debugging this issue but I'm not sure it's worth to go in that direction (maintain soname, etc) as long as the library here (and inside kcachegrind) is for internal usage only.

And I like properly working solutions with minimal impact :)

This revision was automatically updated to reflect the committed changes.