Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: Client Side Translation
Home

[Freeciv-Dev] Re: Client Side Translation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Michael Stefaniuc <mstefani@xxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Client Side Translation
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Oct 2001 11:10:05 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Oct 29, 2001 at 05:42:15PM +0100, Michael Stefaniuc wrote:
> Hello!
> 
> The attached patch starts to implement the first item for the 2.1.0
> version from http://www.freeciv.org/roadmap.html : "Server should
> respond to each client with requested language". 
> But I took a different approach: the server dosn't translate the messages,
> it packs the msgid's and send them untranslated to the client where the 
> translation takes place. Reasons:
>   - Flexibility: the client can use an improved translation or even one
>     that isn't on the server. The server can even be installed without
>     any translation support and the clients will be still able to
>     translate the messages from the server.
>   - Reduced load on the server: the server dosn't need to load more than
>     one translation and dosn't need to switch between translations
>   - Smaller packets: my implementation adds an overhead of 2bytes +
>     1byte for every conversion specification in the format string of the
>     message (should be in general an overhead of 6 bytes) but other
>     languages tend to be longer than english thus relativates the small
>     overhead of my implementation.
>   - when switching to unicode we can use utf8 to encode the messages
>     between server and client with a small increase in the packet size
>     (the msgid's are in english). With server side translation we would
>     need to use utf16 (doubling the size of the messages) or use utf8
>     and pay an even bigger penalty for non-latin charsets.
>   - No need to keep track on the server of the language of the client
>     (no extra packet type).
> 
> Now to the patch ... it is alpha/demo quality code meaning:
> - a lot of places in the server needs to be changed to use the
>   embed_printf function
> - works only when server uses the "C" or "en_US" language (as a result
>   of the first issue)
> - I added a "client_trans" capability but that dosn't work yet (it
>   crashes when server and client haven't both the capability)
> - smarter use of freelog()
> - the implementation of embed_printf is very simple, but it suffices the
>   actual freeciv needs.
> 
> To test it start the civserver:
> LANG=en_US civserver
> and connect some client using different languages to it and start
> playing.
> 
> I will fix the outstanding problems but I wait for comments before I
> invest more time.

Nice. The only problem I have is that is contains a formatstring
parser. But I see no way to avoid this. Can you write down which
restrictions now all format strings in freeciv should
follow. put_uchar_vec should be put_mem (similar to strcpy vs memcpy).

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "Heuer's Law: Any feature is a bug unless it can be turned off."


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