[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-GIFT] i18n-proposal
From: |
Wolfgang Müller |
Subject: |
Re: [help-GIFT] i18n-proposal |
Date: |
Tue, 9 Jul 2002 09:45:53 +0200 |
On Tuesday 09 July 2002 09:01, Pruet Boonma wrote:
> Hi,
Cool to meet you again, Pruet,
> In my opinion, it should be better if we can add new language support
> without the need to alter the MRML DTD. For example, I prefer the
> similar way as <collections> and <algorithms>,
> <i18n-collection-names-list>
> <i18n-collection-names
> lang="en" text="sauerkraut eating contest" />
> <i18n-collection-names
> lang="de" text="Sauerkraute฿wettbewerb" />
> <i18n-collection-names
> lang="fr" text="concours des mangeurs de
> choucroute" />
> So, in my point of view, there are two approaches now, clients tell
> servers which language they prefer. On the other hand, servers send the
> message in every supported language. Then, clients select the
> appropriate language.
>
> I think that the first choice is better.
I agree.
OK To put you all into context, when speaking about "real
internationalization" I was thinking of GNU gettext. I just scanned the
documentation, and if I am not mistaken, having several sessions running on
the GIFT each in a different language would be extremely slow. So we would
have to roll our own i18n, but I still would like it to be inspired by
gettext: In gettext, the program each occurrence of "this is a string" is
replaced by gettext("this is a string"). What gettext() does is look up what
is the current language, and look up the translation. If there is no
translation of the string, the original string is taken.
What I suggest would generating from GNU gettext translation a file
gift-i18n.xml that contains all translations the server is supposed to offer.
These translations we read on startup.
At the same time, we give a list of the mrml attributes/tags we want to be
translated, also to be found in gift-i18n.xml. The rest is understood, I
guess.
For the gift-i18n.xml I suggest
<?xml ...?>
<gift-i18n>
<i18n-attributes>
<attribute name="collection-name"/>
...
</i18n-attributes>
<i18n-database>
<translation-list language-code="de"
<translate key="sauerkraut eating contest" to="Sauerkrauteßwettbewerb" />
</translation-list>
</gift-i18n>
The client won't feel anything, all happens in the server.
Sound reasonable? (I will be offline now for a couple of hours)
Wolfgang