Re: Proposal for declinations in gettext



Hello,
On Sat, Jun 14, 2003 at 02:55:53PM +0200, Danilo Segan wrote:
> Of course, standardized context markers would be only better, not worse. 
> What troubles me is how is that going to help the issue of string 
> composition?
> I think the problem is because programmer doesn't know how many forms a 
> word can take in any language, and that's the number of "context 
> markers" (s)he would need. Or, I misunderstood something.
I'm attempting to suggest just marking the context. The programmer doesn't
(and shouldn't) know what grammar problems there are, as long as they
are solvable with the knowledge of the context.
 
> This is translators job, no?
> 
> Or do you mean: is there a way to extract what strings are used to 
> compose some strings?
Yes, and in what declinations. Without that, the traslator can either
guess or translate up to 7 (or 15) times more than needed.

> If so, I think the answer is no :-( Programming 
> practices at this moment are such that it would require knowledge of 
> much of the code. Again, this kind of work was usually delegated to 
> programmer, and a requirement is imposed on him to write 
> "translator-comments" (as in "here, we'll compose string out of...").
That's why I'm advocating unified context markers.

> >How this would ultimately be implemented is associating a single "gettext
> >context" to two or three messages to pass the declination information.
> >This also means that gettext provides a *printf () replacement that
> >groks the declination syntax. Ultimately, I don't see that much
> >differenece from marking the context "inline".
>
> What do you mean by "marking the context 'inline'"?
The old "move [card]",  "[move] king"

> On the *printf() replacement -- ultimately yes, gettext would need to 
> provide such a replacement. But, how does gettext already handle the 
> order substitution of parameters in format specifiers (%1$s, %2$s,...)?
This is handled by *printf (), as specified by POSIX. Switching
arguments around is much easier, because it doesn't have to change the
values:
	format_string = gettext ("%s %s");
	param1 = gettext ("foo");
	param2 = gettext ("bar");
	printf (format_string, param1, param2);

All printf needs to do is switch the strings around if you specify
"%2$s %1$s". In order to grok declinations, you'd need either
	decl_data = gettext_format ("%s %s");
	param1 = gettext_param (decl_data.param1, "foo");
	param2 = gettext_param (decl_data.param2, "bar");
	printf (decl_data.string, param1, param2);

or an extension of printf (), so that
gettext ("foo") would return mesto;mesta;mestu;.....
and %5;s would select the fifth entry. Pushing this to libc of all
operating systems you want to support looks like a big task to me.
	Mirek



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]