Complete.Org: Mailing Lists: Archives: freeciv-dev: October 1999:
[Freeciv-Dev] Re: on translating "Game"
Home

[Freeciv-Dev] Re: on translating "Game"

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: on translating "Game"
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Mon, 4 Oct 1999 11:03:35 +1000 (EST)

Chyla Zbigniew 76659 <chyla@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Wed, 29 Sep 1999, Jeff Mallatt wrote:
> 
> > Alternatively, a slight modification of the above macro (which would call
> > _() twice):
> > 
> > #define __(s) ((*(_(s)) == '?') ? (strchr(_(s), ':') + 1) : _(s))
> > 
> > would allow the translators to translate these qualified strings into
> > unqualified strings.  E.g.:
> > 
> > msgid "?resource:Game"
> > msgstr "Translation of Game"

As a general note, I think we should at least allow that translaters
will follow the same format as the untranslated string, since I
expect some will do that (and in the absense of other information 
arguably should do), and it will be easiest for us to handle those 
properly rather than try to educate translaters about specials rules.

But the above technique works fine either way, which is ideal :-)

> > 
> > Then, the only restriction is that translation *not* begin with the
> > introducer character.
> 
> Nice idea, but... look at this:
> 
> char *__(char *s)
> {
>    char *ts = _(s);
> 
>    return ts != s ?     
>       ts
>    :
>       *s == '?' ?
>          strchr(s, ':') + 1
>       :
>          s;
> }
> 
> (no restrictions on translated string, compatible with extremely stupid
> translators ;-)

But not with the above idea...

Also, it would be nicer for the argument to this function already
have _() applied, for optimisation of static cases (so then we only
get to test the translated string anyway.)  Also, would prefer this
function to have a meaningful name, and __() be a macro;

eg (untested)

const char *skip_intl_prefix(const char *s)
{
  char *t;

  if (*s != '?') {
    return s;
  } else if((t = strchr(s, ':') != NULL)
    return t;
  } else {
    return s;  /* something wrong */
  }
}

#define __(s) (skip_intl_prefix(_(s)))

-- David

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