[Kde-games-devel] Review Request: KPat: Add command line option to skip directly to a particular game

Parker Coates parker.coates at gmail.com
Sat Feb 14 16:27:39 CET 2009


On Sat, Feb 14, 2009 at 10:00, Luciano Montanaro wrote:
> On venerdì 13 febbraio 2009, Parker Coates wrote:
>
>>
>> The problem lies with the game indices. KPat internally keeps track of its
>> different game types using integer indexes. Unfortunately, for backwards
>> compatibility (I assume) the game indexes are not sequential and some game
>> types have multiple indices. Seemingly random indices aren't a very
>> userfriendly way of referencing the games either.
>>
>> This initial version of the patch adds a game to index mapping to the
>> "--help" text, but it does so in a fairly hideous and non-i18n-friendly
>> way. I had considered using string constants like
>> "--gametype=simple_simon", but I'm not sure if that makes sense in a
>> translated environment.
>
> The point of the commandline switches is to make it possible to start a
> game "programmatically". As we the switches themselves are
> locale-independent, so should be the game type keywords.
>
> If we want to make icons to start a particular game type, having the game name
> localized would mean extra work... We'd need a specialized .desktop file for
> each locale.
>
> I'd prefer some simplified version of the game name (well, just the englis
> game name, with underscores instead of spaces, and with only alphanumeric
> characters).

As requested by Albert, the current implementation accepts both
English and localised values, so I think this meets your requirements.
Any programatic use should just use the English identifiers. I guess
one could complain that the "--help" text currently lists the only
localised values, but that seemed like the simplest solution to me.

The current implementation creates the "keys" by taking the game name,
removing all nonalphanumeric characters and converting all letters to
lowercase. I had considered replacing whitespace with underscores, but
that left me with "forty__eight", so I opted to get rid of them all
together.

Parker

P.S. I'd prefer it if replies were done one the ReviewBoard instead of
mailing directly to the list. We may decide that ReviewBoard isn't
really for us, but I'd like to give it a decent workout before making
that decision. Keeping all comments and the patch in the same place in
one of its bigger strengths.


More information about the kde-games-devel mailing list