[Marble-devel] Problems with translation loading

Friedrich W. H. Kossebau kossebau at kde.org
Fri Jun 3 16:42:50 UTC 2016


Am Donnerstag, 2. Juni 2016, 12:34:13 CEST schrieb Alexander Potashev:
> 2016-06-02 8:25 GMT+03:00 Yuri Chornoivan <yurchor at ukr.net>:
> > Hi,
> > 
> > Testing of Marble form Applications 16.04 shows several problems with
> > translation not shown in widgets and main window.
> > 
> > Findings by Alexander Potashev:
> > 
> > 1. Strings like "Global Search" in
> > scr/lib/marble/SearchInputWidget.cpp:76,99 load through tr(), are
> > extracted
> > into marble_qt.pot but never shown translated.
> > 
> > 2. Options dialog strings, like those from MarbleViewSettingsWidget.ui,
> > are
> > extracted to marble.po, but loaded through qt_wrap_ui (instead of
> > ki18n_wrap_ui) in src/lib/marble/CMakeLists.txt, so strings like "Units",
> > "Distance:", "Angle:" are shown untranslated.
> > 
> > 3. KDE packaging scripts convert marble_qt.po into marble_qt.qm, not
> > marble_qt.mo, so the translations are never shown without some manual
> > intrusion (might be Kubuntu packaging problem). For some reason, packagers
> > include MOs for marble_xml_mimetypes.po and marble.appdata.po (should it
> > be
> > org.marble.appdata.po?).
> > 
> > Can somebody look at these problems and fix them if possible?
> 
> Hi Yuri, Albert,
> 
> CCed kde-i18n-doc in a hope that more people there are familiar with
> Qt translation system.
> 
> Two remarks:
> 
>  1. I think marble_qt.qm is correct because tr() utilizes Qt
> translation system. However, I didn't find any usages of QTranslator
> in Marble (besides in the marble-qt application), so not sure how
> translations could work before.
> 
> Then I tried to insert these lines into
> src/apps/marble-kde/kdemain.cpp just after "QApplication app( argc,
> argv );", but that didn't help:
> 
>     QTranslator translator;
>     translator.load("/usr/share/locale/ru/LC_MESSAGES/marble_qt.qm");
>     app.installTranslator(&translator);

Same here. I copied the code from elsewhere as created by ecm_create_qm_loader 
for another variant, still no success.

But I also could not make it work with the marble-qt, does that work for you?

One thing I found which might hint to the actual problem:
the created marble_qt.pot file misses any msgctxt lines, see
https://websvn.kde.org/trunk/l10n-kf5/templates/messages/kdeedu/marble_qt.pot?
view=markup
while those are present with other pot files which are used with the Qt 
translation system (and should be needed, as *::tr() relies on them.
See e.g. kgantt_qt.pot
https://websvn.kde.org/trunk/l10n-kf5/templates/messages/extragear-graphics/
kgantt_qt.pot?view=markup

Possibly something is wrong in the code which creates the catalogs in Marble's 
Messages.sh?

Cheers
Friedrich


More information about the Marble-devel mailing list