Re: Proposal for declinations in gettext



On Tue, Jun 17, 2003 at 10:30:28AM +1000, Bernd Groh wrote:
> >
> >
> >>It is no problem that the "of" in "king of hearts" is not translated.
> >>you can just omit it, as in
> >>
> >>msgid "Move %s of %s to stack"
> >>msgstr "Flyt %2$s %1$s til bunken"
> >>
> >>which also makes use of the parameter positioning reordering of printf.
> >>   
> >>
> >
> >Of course, it would not work that well for German. You could
> >concatenate "%2$s%1$s" but that would require translating "king" as
> >"könig". Unfortunately, as a noun, the proper translation would be
> >"König"; lower-casing only happens for the compound word.

Yes, lower case is only for the compound word, but you will know that
for a card game you almost always need to descibe a card as a compound
word, consisting of the suit and the rank. Thus it is safe to
translate "King" as "könig" with a small initial letter.

But this actually calls out for a formatting idea: A format specifier
shoul be available to say whether the first character in a string 
should be uppercased or lowercased. In many languages it is required
that the first character in a sentence is capitalized. And in some
languages like German for compound words the first character in
the non-initial word components are lower-cased. We might add some
qualifier to the %s formatting to specify this. This is actually
something that could solve a long standing problem with Danish dates,
where it is customary to write a date:

Tirsdag den 17. juni 2003

Nominally the weekdays are written with an initial small letter in
Danish, but some say that because the weekday is very often the initial 
word in a sentence or phrase with then the definition in the locale 
of weekday names would be that the names have an initial capital
letter. This has actually resulted in KDE resources doing this,
much to my dismay. As this is for dates, which has special formatting
rules and specific APIs the capitalizing/lowercasing capability should
also apply here.
> 
> Completely agree here. Of course, you could do "%2$s-%1$s", i.e. 
> Herz-König, which will definitely be understood, though it doesn't 
> change that the correct translation would be Herzkönig. But, that wasn't 
> necessarily the point anyway, since you don't necessarily have "Move %s 
> of %s to stack" as a msgid. Instead, you might have the following:
> 
> #: 1
> msgid "Move %s to stack"
> msgstr ""
> 
> #: 2
> msgid "%s of %s"
> msgstr ""
> 
> #: 3
> msgid "King"
> msgstr ""
> 
> #: 4
> msgid "Hearts"
> msgstr ""
> 
> 
> Where 3 and 4 are substituted into 2, before 2 is substituted into 1. 
> How do you get rid of the 'of' here? You can only translate "%s of %s" 
> to "%2$s-%1$s", iff you are certain there isn't any "x of y" where 'x' 
> not in (Two, Three, ...., King, Aces) and 'y' not in (Diamonds, Hearts, 
> Spades, Clubs). As such, you do require context, as following:
> 
> #: 2
> msgid "[playing card]%s of %s"
> msgstr ""

Hmm, that scheme is not likely, as far as I can tell from experiences in
translating a number og card games, and a lot of other Open Source 
software. Anyway the programmers will probably do something that is
well suited for translation, to get the best product out there.
If not, the translators may advice the programmers.
> 
> Now, while this might still appear easier for the engineer from a 
> development perspective, the engineer, most and for all, *must know* 
> that this context is required in the first place. Since whether someone 
> is the Queen of Hearts or whether we have the playing card Queen of 
> Hearts, it's still 'Queen of Hearts' and '%s of %s' is still '%s of %s'. 
> In a translation, on the other hand, that might be completely different 
> (e.g. for German it would be 'Königin der Herzen' and '[playing 
> card]Herzkönigin'). So, do we expect the engineer to know whether a 
> context is required in the translation or not, or do we simply expect 
> the engineer to just add a context for everything now? An alternative 
> might be that we do require a context for every part of a composed 
> string. Then, the engineer would simply have to think of a way to 
> describe what exactly s/he means, so that the translator will later on 
> know what exactly the engineer referred to, i.e. that the translator 
> knows in which whole the part is substituted into.

> Question now is, is it really easier for an engineer to consider such 
> context issues, or to simply use the printf-method to simply generate 
> all complete msgids and let the translator handle the rest?

Come on, we are talking of a card game, here the context is clear. 
So it would be in most other programs. 
And if it is not clear you may introduce comments in the .po file.

> If you have everything in one string, then you don't need to worry about 
> whether translators know that you can reorder %s, %s with %2$s, %1$s either.

yes, but it is very cumbersome, and probably could be done much more 
elegantly.

> And another considerable advantage of having everything in one string is 
> following:
> 
> #: 1
> msgid "Move King of Hearts to stack"
> msgstr "Lege den Herzkönig auf den Stapel"
> 
> #: 2
> msgid "Move Queen of Hearts to stack"
> msgstr "Lege die Herzdame auf den Stapel"


Yes that may be a point. I am not aware of other languages than German
where this would be necessary, and even in German it is not necessary.

Venlig hilsen
keld



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