Hello,

This is indeed interesting information.
I'm forwarding to the mailing least because i thing other people might
be interested in thins kind of stuff (probably Torangan, Ivanovic and
Shadowmaster at least).

As you could probably see i did some research in this area too, but did
not commit something yet and i was almost totally inactive too on the
wesnoth project lately.

I had several different ideas to implement this feature :
- through a WML tag (which i implemented but decided not to commit) :
This would be sufficent for 95% of the case, but it's less intuivive
and elegant.
- though t_string (which i started to implement too but was too
busy/lazy to finish (and gone in holiday too ;))). My main concern here
was the interaction with WML variables.
You're probably more advanced than me in this aread, so feel free to send
a patch. It's not too late.
I think it is desirable that string used for the number string used for
the ngettext() call, but the two others (singular and plural form)
should not be parsed prior to the call. Else the feature won't look very
useful in my opinon.
The bad news is translatable strings are sometime used in WML outside of
the space where WML variable exists (like scenario names/descriptions for
example).
If i recall t_strings are parsed before any WML substitution is done.
I did not try to solve this problem yet.
By the way probably 99% of the usage of the plural would occur inside a
scenario, where we have WML variables.
I have one example where this might be nice to have this ouside areas
where we have WML variable : scenarios generated from WML macros where
you might want one of the macro parameters to appear i the title or
description.

Another thing to do is to modify wmlxgettext (currently written in perl)
to regognize our new syntax for plural (which we have to define too).
Well i don't know perl at all, but i might try too learn.

Have nice holidays,

Benoît Timbert aka "Noyga"

----- "Vladimír Slávik" <[EMAIL PROTECTED]> a écrit :

> Hello,
> I am kind of away for two months (still in progress), so my
> information is a bit out of date. Today I opened the tracker just to
> see what's going on and noticed you did some work concerning
> pluralization.
> 
> Before leaving I played a bit with that idea as well and did some
> research. If I understood correctly, wml is parsed directly into the
> config structure which uses t_string as an universal string container,
> overloaded to death with implicit typecasts to mix well with any kind
> of string.
> 
> As a result, I decided the t_string class is the root of any possible
> problems and obstacles, and wrote a cleanroom implementation, except
> never linked to try out. Because it still lacks a few interface
> members. The missing parts are serialization related functions for
> binary wml which is deprecated but still present in code :-( So I
> didn't really get to test it at all. But it has definitely potential
> not to crash and run, just the speed is a big unknown.
> 
> Anyway, you might be interested in the fact that this class always
> stored the wml's _"" strings together with domain which seems was one
> of your concerns (at least the comment in tracker suggests that).
> Without going into the details, my t_string version can (if it really
> works) contain plural string fragments as well, so if this particular
> field is still open, maybe there are alternative solutions based on
> this. Such as having some kind of alternative syntax in wml, or
> anything else you could imagine with plurals.
> 
> The obvious advantage t_string rewrite for plurals has is that from
> the point where you parse the string and store it, you don't have to
> care about anything (in the main code).
> 
> If you want, I have the t_string files backed up / hidden somewhere on
> my ipod here with me (it's 100% new code so no need for patches at
> all), but it would be unfair to make you debug and complete something
> I just started writing. Let's eventually leave the hair-tearing for
> Bouncman :-)
> 
> I just thought this information could be of some interest to you. If
> you got your code to work, it's probably too late, but let's see...
> 
> PS: I'm returning in September, but I'll check my mail regularly from
> now on.
> 
> Vladimír Slávik (VS, VladimirSlavik etc.)

_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev

Reply via email to