From kde-i18n-doc Thu Aug 11 19:34:35 2005 From: Chusslove Illich Date: Thu, 11 Aug 2005 19:34:35 +0000 To: kde-i18n-doc Subject: Re: KGeography needs your help Message-Id: <200508112134.38382.caslav.ilic () gmx ! net> X-MARC-Message: https://marc.info/?l=kde-i18n-doc&m=112378898123780 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart5537539.1BJOPmZBUs" --nextPart5537539.1BJOPmZBUs Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline > [: 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 "=D0=93=D1=80=D0=B5=D1=86=D0=B8=D1=8F= " 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=20 continuation of msgstr, was exactly because it already is in app's own PO=20 file, not requiring any extra effort (like generating own files, etc.)=20 Also, it works precisely because app actually takes those country names=20 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,= =20 and you (properly) wan't to solve it in one place, the catch is that the=20 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= =20 no reason to do so. Remeber, whenever PO file is loaded, scripting system=20 looks if there is corresponding script file (like kdelibs.po and=20 kdelibs.scm) and loads it if present. That .scm file can in turn load=20 other .scm files. Now, one of those other files can be the one with forms=20 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 ...) =2E.. You could call it forms.scm and install it under=20 $KDEDIR/share/locale/ru/LC_SCRIPTS/kdelibs/forms.scm. Then, to use it in=20 eg. KGeography, in $KDEDIR/share/locale/ru/LC_SCRIPTS/kgeography.scm you=20 would just add one line: (load "kdelibs/forms.scm") Now in kgeography.po you can use, just as before, "The capital of=20 $[genitive %1]:", but you don't have to do any scripting for messages=20 "Greece", "Italy", "Spain", etc. > This line in proper Russian would be: > "$[=D1=80=D0=BE=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9-=D0= =BF=D0=B0=D0=B4=D0=B5=D0=B6: =D0=93=D1=80=D0=B5=D1=86=D0=B8=D0=B8]" # "$[= has genitive Grecii]", > > and > > "=D0=A1=D1=82=D0=BE=D0=BB=D0=B8=D1=86=D0=B0 $[=D1=80=D0=BE=D0=B4=D0=B8=D1= =82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9-=D0=BF=D0=B0=D0=B4=D0=B5=D0=B6: %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=20 in front of case (like that "has") in order to differ from the=20 form-getting command. This "differing" element is actually the name of the= =20 macro which does the job under the hood. As for too long names of cases, nobody is forcing you to use them like=20 that. They are just identifiers you agree upon. I certainly won't use=20 "=D0=BF=D0=B0=D0=B4=D0=B5=D0=B6-=D0=B3=D0=B5=D0=BD=D0=B8=D1=82=D0=B8=D0=B2"= , and possibly not even "=D0=B3=D0=B5=D0=BD=D0=B8=D1=82=D0=B8=D0=B2", but s= ay no more than=20 "=D0=B3=D0=B5=D0=BD" :) =2D-=20 Chusslove Illich (=D0=A7=D0=B0=D1=81=D0=BB=D0=B0=D0=B2 =D0=98=D0=BB=D0=B8= =D1=9B) Serbian KDE translation team --nextPart5537539.1BJOPmZBUs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBC+6hOMSGXgigGr3ERAvB4AJ9JjYE1wDQa9+wgljnm9P7SFbDlegCeIpw/ yQBI3DjUSecNRRQGkHsEhTk= =E4wM -----END PGP SIGNATURE----- --nextPart5537539.1BJOPmZBUs--