[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Unicode keystrokes (was: Nikola's map)

Grrr, I hate it when it does that.
Here it is again, this time hopefully in full...

On 12.12.2006 23:47, Jens Granseuer wrote:
On 12.12.2006 09:55, Nikola Smolenski wrote:
> And now, for something completely different.
>> I translated basic strings to Serbian, however the game had problems with> Cyrillic. So, here is the translation and a patch which solves the problems> (to see the problems, just see the translation without the patch).

You should remove the revision marker from your translation and rather add
a noting saying which reveision of the base (ie. 'en') file you used to
create it.

> Description of the patch: I introduced new variable in class Widget called> 'keypos' which contains the position of the highlighted key. As additional> advantage, it will highlight exactly that key, so, for example, (mad up)> strings:
> will be displayed correctly.

Please use diff -u (and -p if your version supports it) when creating diffs.

I then made a new function called 'ASCIIEquivalent', which returns - well, see
the description. If it is needed, in the same way non-ASCII characters for
French, German, Polish, Slovak etc. could be introduced.

The ASCIIEquivalent function is desperately in need of some comments. I don't know Cyrillic, and I don't understand the algorithm used to get those ASCII representatives. I could probably do so if I studied some ASCII and Unicode tables, but it'd be nice if I didn't have to. Apart from that, this function should be added to the StringUtil class instead of Widget.

That said, I worked on Unicode support for key strokes a while back (and
I even have a patch), but I took a different road because e.g. many
(well, all, rather) German umlauts are actually available on my keyboard,
so I don't need to use a for ä, for example, and the same is probably
true of other languages as well. We'll need to see how that fits together.

Also, are you sure that only Chinese uses more than 2 bytes for
representing a character? Otherwise we may need a proper UTF-8 decoder.

Other than that, looks good.