[Freeciv-Dev] Re: I18n problems
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 27 Sep 1999, Jeff Mallatt wrote:
> My only other question is whether or not to make the macro more robust.
> What happens if _() returns something that doesn't contain a colon?
Similar question: what happens if translator uses "%s" instead of "%d"?
You can't avoid translator's stupidity ;)
If you really want to be safe:
#define __(s) ( i18n_tmp = strchr(_(s), ':') ? i18n_tmp + 1 : _(s) )
(using global variable "char *i18n_tmp")
alternatively (calling strchr() twice):
#define __(s) ( strchr(_(s), ':') ? strchr(_(s), ':') + 1 : _(s) )
Zbigniew Chyla
|
|