[Kde-games-devel] Killbots message extraction, missing itens?

Parker Coates parker.coates at gmail.com
Fri Dec 5 23:22:33 CET 2008


On Sun, Nov 23, 2008 at 11:59, Parker Coates wrote:
> I've just run into another localisation issue in Killbots, although
> this one is certainly less critical.
>
> In Killbots I provide two separate sets of keyboard controls which
> both require a 3 by 3 block of movement keys along with some nearby
> keys for special actions.
>
> One set uses the numeric keypad which works out really well as it's a
> nicely defined block of keys surrounded by extra keys for the special
> actions. The problem is that most laptop users don't have numeric
> keypads (and I doubt they'd really want to use some Fn key based
> solution). So a second set is required.
>
> For the second set, Killbots currently uses the Q, W, E, A, S, D, Z,
> X, C key block for movement controls. This is all fine and dandy for
> me as an English user with a US keyboard layout, but I would assume
> this is absolutely useless most other locales. Sure the user can
> redefine the shortcuts to something they find more useful, but this
> seems like something that could be handled through localisation to
> provide a better out-of-the-box experience for non-English laptop
> users.
>
> Is there a way to do this? I checked the localisation tutorials on
> TechBase, but shortcut keys weren't mentioned there.

It turns out this is much simpler than I had anticipated. One of the
QKeySequence constructors accepts a QString representation of the
shortcut. So implementing translatable default shortcuts should be as
simple as a bunch of calls like the following.

upLeftAction->setShortcut( QKeySequence( i18nc( "Default key to move
up and left", "Q" ) ) );
upAction->setShortcut( QKeySequence( i18nc( "Default key to move up", "W" ) ) );

Does this seem like a reasonable thing to ask translators to do? Can
anyone see any holes in this solution? If not, I plan on implementing
it in 4.3?

Parker


More information about the kde-games-devel mailing list