Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2505) Game end messages not translated
Home

[Freeciv-Dev] Re: (PR#2505) Game end messages not translated

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ChrisK@xxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2505) Game end messages not translated
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Sun, 8 Dec 2002 00:33:56 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, 2002-12-07 at 10:15, ChrisK@xxxxxxxx via RT wrote:

> Hey, what are you talking about? Sorry, but I don't understand.
> I've never heard of a crash due to translation / i18n. Of course
> we all want to have client side translation (I hope). What is wrong
> with a
> 
>      notify_conn(&game.est_connections, 
>          _("Game ended in victory for %s"), victor->name);
> 
> What is so special with this part, that you don't want to translate it?
> Please explain, I'm learning.
> 
> At least these are the last texts that are not translated AFAICS.
> And they require nearly no effort to fix.

I'm no expert on this, but...

The above code will have the server translate the text, then send it to
all clients.

Suppose this is a game on civserver.  This means the text will be
translated into English, then sent out to all players.  If one player is
using a German locale, one player is using an Italian locale, and one
player is using an English locale they will still all see the text in
English.  But at least in all of these cases the players are using
similar character sets, so the text will at least be recognizable.  But
if another player is connected using a Japanese locale, what text will
they see?  I suspect garbage.

[These problems will happen whether translation is done here or not.  In
fact, translating these texts is better in almost all cases, since the
client's and server's locale will be the same.  But translating the text
into the server's local is certainly not a complete solution.  See
PR#2374 for what I think is an attempt at a real solution for the i18n
part of the problem (but again, I'm no expert - and I'm not sure who
is...).]

I believe there's also a larger character set problem, which is what can
potentially cause a crash.  Suppose the server is using English, and the
client is using a character set that uses wide (16-bit) characters.  (I
think this is possible, right?)  Now not only may the game text be
garbage, but it might not even be a valid string.  If the GUI doesn't
check this properly, there are bigger problems.

And this problem is larger still when you consider the text data that
the server sends to the client.  City, nation, and leader names are in
(I think) the latin1 encoding (which will probably work for all european
languages, i.e., all languages used by developers).  If the client's
encoding isn't compatible and the client doesn't convert the text (which
is generally impossible anyway, I think) then _really_ bad behavior can
result.

[For instance in Red Hat 8 in English, I find my default encoding to be
(I think) ascii.  This cannot properly display the special latin1
characters.  So I find that many eastern European names are simply
truncated and cannot be used - see PR#2445.  This can be corrected by
changing an environment variable, but how many players know to do that?]

AFAICT the only true solution here is to use a UTF encoding (e.g.,
utf-8) for all text data.  This means that nearly all languages will
have the problems that only a few non-Latin languages currently have,
but it allows a single combined solution to apply to all languages.

A partial solution would be to put all game data into pure ASCII.  This
would ruin the flavor IMO because all localized characters would have to
be dropped.  But it would allow support of all ascii-compatible
charsets.

For more information, see:

  http://www.gnu.org/software/libiconv/
  "man latin1"

...or just ask Vasco, from whom I got much of my information (but don't
blame him for my mistakes).

jason




[Prev in Thread] Current Thread [Next in Thread]