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

[Freeciv-Dev] Client Side Translation

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Client Side Translation
From: Michael Stefaniuc <mstefani@xxxxxxxxx>
Date: Mon, 29 Oct 2001 17:42:15 +0100

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.

bye
        michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani@xxxxxxxxx
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart

Attachment: clientsidetranslation.diff.gz
Description: GNU Zip compressed data


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