Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Re: Improved grammatic handling of nation names.
Home

[Freeciv-Dev] Re: Improved grammatic handling of nation names.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Improved grammatic handling of nation names.
From: Stan Shebs <shebs@xxxxxxxxxxxxxxxxx>
Date: Mon, 04 Sep 2000 07:25:52 -0700
Reply-to: shebs@xxxxxxxxxxxxxxxxx

Jeff Mallatt wrote:
> 
> Two dimensions might be a problem, in general.  The ruleset files might
> contain a single "namelist", that would be translated, e.g.:
> 
>   name="German"
>   namelist=_("German|Germans|Germans'|A German|a German\
>   |A German's|a German's|The German|the German\
>   |The German's|the German's|The Germans|the Germans\
>   |The Germans'|the Germans'")
> 
> And, the code would look something like:
> 
>   i18nsprintf(buffer,
>               _("%a[11] did something to %a[12]."),
>               get_nation_namelist(attacker->nation),
>               get_nation_namelist(defender->nation));
> 
> Since the translators would have control of both parts (the name list and
> the format string), this would be most general -- a translator could even
> add cases that exist only in their language.

If you named things and used a positional notation in the string
(which is what the Mac does to enable localization for dialog boxes
and such), you can solve both problems at once:

   i18nsprintf(buffer,
               _("%sp0 did something to %op1."),
               get_nation_namelist(attacker->nation),
               get_nation_namelist(defender->nation));

where the basic directives are %0 and %1 to print the args,
and "s", "p", and "o" are modifiers to request "subject",
"plural", and "object", respectively.  Then you add bits to
the namelist to identify each variation on the name (Xconq
allows six - name, long name, short name, noun, plural-noun,
and adjective).

Stan
shebs@xxxxxxxxxxxxxxxxx



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