[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: KGeography needs your help
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2005-08-11 19:34:35
Message-ID: 200508112134.38382.caslav.ilic () gmx ! net
[Download RAW message or body]


> [: Gregory Mokhin :]
> Is it possible to maintain these forms in one file, say,
> kdelibs/ru-inflections.po, that would be like an inflection database
> for a language? A translation team would be responsible for
> maintaining this file for its language.
>
> I am too lazy to type all the forms again and again in all po files,
> even with translation memory of KBabel it is not always feasible.
> [...]
> Keeping all these forms in one file has the advantage that I can write
> a script for Russian that will take "Греция" as an input word and
> automatically construct all six grammar forms for it. This way a list
> of Russian geographic names will be instantly transformed into a
> comprehensive po file with all forms.

The reason of putting things like in previous examples, in PO file in the 
continuation of msgstr, was exactly because it already is in app's own PO 
file, not requiring any extra effort (like generating own files, etc.) 
Also, it works precisely because app actually takes those country names 
from its PO file, thus invoking the attached form-setting script.

Now, if you have those forms of same word scattered over several PO files, 
and you (properly) wan't to solve it in one place, the catch is that the 
app wouldn't take your special PO file. But this is not a problem :)

As you said, from the input you would *generate* the PO file, but there is 
no reason to do so. Remeber, whenever PO file is loaded, scripting system 
looks if there is corresponding script file (like kdelibs.po and 
kdelibs.scm) and loads it if present. That .scm file can in turn load 
other .scm files. Now, one of those other files can be the one with forms 
that you automatically generate. You could generate a file like this:

(forms-of Greece  genitive Greecee  dative Greecei ...)
(forms-of Italy  genitive Italye  dative Italyi ...)
(forms-of Spain  genitive Spaine  dative Spaini ...)
...

You could call it forms.scm and install it under 
$KDEDIR/share/locale/ru/LC_SCRIPTS/kdelibs/forms.scm. Then, to use it in 
eg. KGeography, in $KDEDIR/share/locale/ru/LC_SCRIPTS/kgeography.scm you 
would just add one line:

(load "kdelibs/forms.scm")

Now in kgeography.po you can use, just as before, "The capital of 
$[genitive %1]:", but you don't have to do any scripting for messages 
"Greece", "Italy", "Spain", etc.

> This line in proper Russian would be:
> "$[родительный-падеж: Греции]"   # "$[has genitive Grecii]",
>
> and
>
> "Столица $[родительный-падеж: %1]:" # "The capital of $[genitive %1]:"
>
> to say nothing of other 5 inflections (that have equally longer
> names), three genders and three plural forms in Russian.

Here I must point out that the form-setting command has to have something 
in front of case (like that "has") in order to differ from the 
form-getting command. This "differing" element is actually the name of the 
macro which does the job under the hood.

As for too long names of cases, nobody is forcing you to use them like 
that. They are just identifiers you agree upon. I certainly won't use 
"падеж-генитив", and possibly not even "генитив", but say no more than 
"ген" :)

-- 
Chusslove Illich (Часлав Илић)
Serbian KDE translation team

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic