[Kde-games-devel] Hardcoded Quotation in KGoldrunner
Ian Wadham
ianw2 at optusnet.com.au
Sat May 23 12:23:50 CEST 2009
Some light is falling upon this issue now.
On Fri, 22 May 2009 6:49:03 am Albert Astals Cid wrote:
> A Dijous, 21 de maig de 2009, Frederik Schwarzer va escriure:
> > There is some oddness of the following code in src/kgoldrunner.cpp
> >
> > 887 // Now update the PAUSE/RESUME message in the status bar.
> > 888 kDebug() << "Update Pause/Resume message ...";
> > 889 pauseKeys =
> > myPause->shortcut().toString(QKeySequence::NativeText);
> > 890 pauseKeys = pauseKeys.replace (';', "\" " + i18n ("or") + " \"");
> > 891 gameFreeze (frozen);»···»···// Refresh the status bar text.
> >
> > The string translators see is
> > Press \"%1\" to PAUSE
> >
> > In German this is translated as
> > Drücken Sie „%1“, um eine Pause zu machen
> >
> > Together with the above code, it looks like this in KDE 4.2:
> > Drücken Sie „P" oder " ESC“, um eine Pause zu machen
> >
That "odd" code has been in KGoldrunner for about 5.5 years and
was first released in KDE 3.2. It is now nearing the end of its
working life and will be gone whenever I can finish replacing the
status bar with graphical objects (e.g. in KDE 4.4 now), so I do not
propose to break string freeze by re-writing the code at this late stage.
BTW, at the time I wrote it there was a lot we did not understand
about translation ... and my main problem was to find some way
to get hundreds of strings in the game data translated at all. The
only way to do it was if the strings were in some C++ source-code
module apparently. We have come some way since then ... :-)
> > However, it looks like this in KDE 4.3:
> > Drücken Sie „P“, um eine Pause zu machen
> >
> > The Shortcut settings are the same.
> >
> > So, what's going on here?
> > If it was changed for KDE 4.3 to only return the primary shortcut then
> > the code can be skipped. If there should be both shortcuts, the code is
> > quite unfortunate i18n-wise.
>
> Ian changed myPause from KAction * to QAction * in 924446 that's what is
> causing only one shortcut to appear, Ian any reason you did that?
>
That was an accidental commit of code I was playing around with during
Akademy 2008, trying this, trying that, to get it to fix some issues raised by
Albert and still handle alternate shortcuts --- and still compile correctly.
See: http://lists.kde.org/?l=kde-games-devel&m=121726800213299&w=2
I now find that reverting to "KAction * myPause" works and seems to get
the results Albert was looking for in July last year. It looks as though Qt
and kdelibs must have improved the methods for handling multiple shortcuts
and "toString()" since July last year. I will test it all some more and then
commit. So the status bar message will again display either one shortcut
or two, as it has for the last 5 years or so.
Cheers, Ian W.
More information about the kde-games-devel
mailing list