Complete.Org: Mailing Lists: Archives: freeciv-dev: August 1999:
Re: [Freeciv-Dev] i18n for all eternity
Home

Re: [Freeciv-Dev] i18n for all eternity

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Dev <freeciv-dev@xxxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] i18n for all eternity
From: Artur Biesiadowski <abies@xxxxxxxxx>
Date: Thu, 26 Aug 1999 11:49:49 +0200

Alex Zepeda wrote:

> Essentially you create a function such as
> 
> char *i18n(const char *msg)
> {
>   return gettext(msg);
> }
> 
> Now, I'd say use a function because functions are cheap, and it makes it
> easier to do more complex things or switch to another i18n system.  You
> can use gettext (which xgettext will pick up automatically unless told not
> to) or some other things (see the info page).
> 
> Then you put all the string constsants you want to be i18n'd in a call to
> the i18n function.  So let's say you have:
> 
> sprintf(buf, "Unit: %s %d/%d/%d");
> 
> to i18n this you would simply do:
> 
> sprintf(buf, i18n("Unit: %s %d/%d/%d"));


Why do you want to use i18n(..) instead of plain _() and N_() ? It is a
faster to type _(), more standard and I think more readable (as it does
not put letters before string, thus making it harder to read  ).

If you worry about using different methods for i18n you can define _
function as well as i18n instead of including gettext headers. Or make
it a macro - as it is in gettext.

Please stick to _/N_ (BTW, you will need Ni18n or something similar
also...)

Artur


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