Re: Proposal for declinations in gettext



Keld,

as said, I wasn't really talking about card games. As I understood it, 
card games simply came up as an example of where the general rule to use 
complete strings causes a lot of "noise". And while this is true, it 
doesn't really change that in general complete strings should be used, 
exactly because composite strings can cause several problems. While it 
may work out for the very restricted context of a card game, doesn't 
mean anything with respect to something more general. The examples I 
brought up here within the context of a card game, are not necessarily 
problems within the context of a card game, but are meant to be 
illustrative of the problems you might (IMO will) face in general. 
That's all. I believe not generating thousands of msgids for a card game 
is fine, let's just restrict this method to these very specific cases, 
please. :-)


Keld Jřrn Simonsen wrote:

>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.
>

As said. ;-)


>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.
>

Or maybe we could set global rules for a language, i.e. words at the 
beginning of a sentence start with an upper-case character. As such, you 
could simply use words as they are translated (lower-case if), and then 
simply capitalize the first letter in a sentence? This, of course, would 
require us to know where the sentences (if multiple) start, which is 
non-trivial. Maybe we can have something like %S instead of %s to denote 
a variable at the beginning of a sentence (not assuming printf is called 
directly on the string).


>>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.
>

That was meant to be an advice. :-)
As in, please do so if you have to use composite strings, but actually 
meaning, no, don't do so, please use complete strings. ;-)


>>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.
>

As said. ;-)
And while this may apply to other programs to, some programs have quite 
a few msgids. And if you should happen to use composite strings, you 
have quite a chance to end up with an entry '%s to %s', where it is used 
in two different contexts, for both of which it should be translated 
differently. As such, context is required. And the context cannot simply 
be within the comments, since you would then have two identical msgids.


>>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.
>

IMO, neither %2, %1, nor %2$s, %1$s is very elegant, since it doesn't 
necessarily work. What happens to these strings internally? Is there 
some pre-processing done before these are passed to printf? Is the use 
of %2$s, %1$s documented anywhere as a supported feature of gettext? If 
yes, where? Cause if it is, I need to file a bug-report.


>>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.
>

Believe me, it is necessary. Not necessarily for a card game, but we're 
not talking about card games, or are we? :-)

Cheers,
Bernd


>Venlig hilsen
>keld
>_______________________________________________
>gnome-i18n mailing list
>gnome-i18n@gnome.org
>http://lists.gnome.org/mailman/listinfo/gnome-i18n
>  
>


-- 
Dr. Bernd R. Groh                     Email: bgroh@redhat.com
I18n/L10n Engineering                 Phone: +61 7 3872 4847
Red Hat Asia-Pacific                  Fax  : +61 7 3257 4800

"Everything we know is an illusion, nothing we know is real,
 nothing real we can know, illusion is what we call reality."

        Disclaimer: http://apac.redhat.com/disclaimer





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