[Kde-games-devel] untranslated strings in kdegames

Ian Wadham ianw2 at optusnet.com.au
Thu Sep 27 16:05:42 CEST 2007


On Thu, 27 Sep 2007 06:22 am, Albert Astals Cid wrote:
> But KGameTheme is not using them correctly, API of KConfig is not so cool
> and using entryMap() does not give you the translated entries, you should
> use readEntry for each of the entries indivially i'd say.
>
I am using readEntry (), so why are my theme names not automatically
translated at run time?  "KGoldrunner Default" is in xx language in the
.desktop file and all KGoldrunner theme names are in German [de].  See
the code extract below (from file kgoldrunner/src/kgoldrunner.cpp).

Cheers, Ian W.

KToggleAction * newTheme;                           // Action for a theme.
QString actionName;                                 // Name of the theme.
QList<QAction *> themeList;                         // Themes for menu.
QActionGroup * themeGroup = new QActionGroup (this);
themeGroup->setExclusive (true);                    // Exclusive toggles.

foreach (QString filepath, themeFilepaths) {        // Read each theme-file.
    KConfig theme (filepath, KConfig::OnlyLocal);   // Extract theme-name.
    KConfigGroup group = theme.group ("KDEGameTheme");      // Translated.
    actionName = group.readEntry ("Name", i18n("Missing Name"));

    newTheme = new KToggleAction (actionName, this);
    themeGroup->addAction (newTheme);               // Add to toggle-group.
    ....
}


More information about the kde-games-devel mailing list