Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: (PR#2374) multi-language client-server patch
Home

[Freeciv-Dev] Re: (PR#2374) multi-language client-server patch

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: matusik_s@xxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2374) multi-language client-server patch
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 27 Jan 2003 23:22:36 -0800
Reply-to: rt@xxxxxxxxxxxxxx

mateusz stefek via RT wrote:
>>Could you also add comments for every meta-sequence (% sequence)
>>explaining why they are needed (i.e. why the same behaviour could not
>>be
>>done without them)?  I suspect for a number of them we will find it is
>>
>>possible (and if I'm wrong, I want to know why - it is not immediately
>>
>>obvious and should be commented).
>>
>>jason
>>
> 
> Ok, I left only these which are obvious, and U - for units.
> For further extensions (I.e declination, plural forms)
> declination = german "Deklination" (my dictionary is poor)

Well, what I want to know is *why* these are necessary.

> Please comment below if you have any question:
> 
>    s - the string which will be translated
>    S - the string which will stay unchanged

We clearly need both strings that will be translated (i.e., most texts) 
and some that won't be (i.e., city and leader names).  Since the 
translation must come at the client end, we need two separate 
meta-sequences for it.

I do wonder why they are s and S instead of S and s - does it make more 
sense to reverse the sequences?  Up to you...

>    U - unit type (the argument is Unit_Type_id) which will be       
> replaced with its translated name.

I don't understand why this can't just use %s with the unit's name.

>    L - There are 2 arg: (x, y) which
>        will be replaced with       get_location_str_in(x, y)
>    A - There are 2 arg: (x, y) which
>        will be replaced with       get_location_str_at(x, y)

Wasn't there a recursive form of the meta-sequence before?  Why couldn't 
that be used, along with %s and %S?  For instance:

R - There is one arg - another FIMS structure.

struct fims fims;
get_location_fims_in(x, y, &fims);
vnotify_player_ex(player, N_("Game: you lost your %s (%R)."),
                  unit_name, fims);

Perhaps this is not worth it and it is easier just to use %L and %A. 
But I believe these are not truly necessary since the logic is known 
both to server and client.

>    P - There are 3 args (string1, string2, int n) which
>        will be replaced with PL_(string1, string2, n)
>        This is a recursive directive.

I agree, this must exist since the logic must all be done at the client end.

>    M - the Nation_Type_id, which will be replaced with get_nation_name
>    N - the Nation_Type_id, which will be replaced with 
> get_nation_name_plural
>        N & M can be used interchangeably by translator

Why can't %s be used for these two?

>    I - struct fims_impr, which you can get from get_fims_impr()
>        This "sends" get_impr_name_ex() to the client

Again, why not just use %s?

>    X - future_tech_no & Tech_type_id will be replaced with 
> get_tech_name() or       "Future Tech. %d"

Here %R could be used, or the server could just use a conditional:

if (tech_id == A_FUTURE)
   vnotify_player_ex(player, N_("Game: you discover Future tech %d."),
                     player->future_tech_count);
else
   vnotify_player_ex(player, N_("Game: you discover %s!")",
                     get_tech_name(tech_id));

>    Y - year will be replaced with textyear()

Same as %X...it doesn't seem necessary.

>    F - flag, will be replaced with get_units_with_flag_string

Same.

>    % - for '%'

Yes, this is necessary.

-----

Anyway, it is possible/likely I am wrong about this.  But I want to know 
why...there should be a comment explaining it all in the code.

jason




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