[kde-doc-english] KAboutData::translators() returns nothing

Luigi Toscano luigi.toscano at tiscali.it
Thu Oct 15 21:51:19 UTC 2015


Thomas Eschenbacher ha scritto:
> Hi,
> 
> could someone please give me a hint what is the secret clue behind
> KAboutData::translators() ?
> I use that call in my help/about dialog to get a list of translators.
> 
> I see that extract-messages.sh produces two entries in my application's
> pot file:
> 
> msgctxt "NAME OF TRANSLATORS"
> msgid "Your names"
> msgstr ""
> 
> msgctxt "EMAIL OF TRANSLATORS"
> msgid "Your emails"
> msgstr ""
> 
> and in my po file I see the corresponding two entries, which IMHO are
> correctly filled out:
> 
> msgctxt "NAME OF TRANSLATORS"
> msgid "Your names"
> msgstr "Thomas Eschenbacher"
> 
> msgctxt "EMAIL OF TRANSLATORS"
> msgid "Your emails"
> msgstr "Thomas.Eschenbacher at gmx.de"
> 
> But what could then be the reason for KAboutData::translators() to fail?
> I looked at the source of that function to see what goes on there. The
> core seems to ne a call to QCoreApplication::translate to get the
> translated texts, so I hacked these lined into my main.cpp, just before
> the call to app.exec():
> 
>     #define NAME_OF_TRANSLATORS "Your names"
>     QString name = QCoreApplication::translate("KAboutPerson",
> NAME_OF_TRANSLATORS, "NAME OF TRANSLATORS");
>     qDebug("this fails: '%s'", name.toLocal8Bit().data()); // <- prints
> "Your names"
> 
> But on the other hand: using i18n(...) works fine:
>     qDebug("this works: '%s'", i18n("Your names").toLocal8Bit().data());
> // <- prints my name!
> 
> What the heck goes wrong here???

I think it's better to ask on kde-i18n-doc@ or directly on kde-frameworks-devel at .

Ciao
-- 
Luigi


More information about the kde-doc-english mailing list