From kde-i18n-doc Mon Jun 28 12:01:08 2010 From: Chusslove Illich Date: Mon, 28 Jun 2010 12:01:08 +0000 To: kde-i18n-doc Subject: Re: File templates: menu item is also used as default file name Message-Id: <201006281401.21395.caslav.ilic () gmx ! net> X-MARC-Message: https://marc.info/?l=kde-i18n-doc&m=127772684518833 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart2940496.JEgU5LUM0f" --nextPart2940496.JEgU5LUM0f Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable > [: Alexander Potashev :] > For example: > > #: apps/lib/konq/Templates/linkProgram.desktop:2 > msgctxt "Name" > msgid "Link to Application..." > > [...] > > The problem arises when you want to translate the menu items as File- > >Create->[something] and write [something] in accusative case: the menu > item name should be different from the default file name. > > So, how hard would it be to "split" the strings? Will this change break > compatibility with other software? There is probably no compatibility issue, as it seems to me that these =2Edesktop files are internal to KDE. Still, as Albert mentioned, to support what you need on the code side would require substantial complication, and one which is a special case useful only for some languages. However, this is not to say that one cannot have his accusatives. It would have been simpler if it didn't involve .desktop files, but it's possible either way. And it (almost) does not involve the code and the programmer, only the translator. Suppose there was a "filtering message" added to wherever the "Create New" menu is being populated with items (e.g. in Dolphin), through which each item is passed just before it is added to the menu: msgctxt "@item:inmenu Create New (file type)" msgid "%1" msgstr "" This is the only modification required in the code, and one as non-intrusive as it gets. (May cause some communication overhead with the perplexed maintainer of that code, though.) Providing that you add l10n-kde4/ru/scripts/kdelibs/kdelibs4/kdelibs4.js with something little in it, you could translate this message as: msgctxt "@item:inmenu Create New (file type)" msgid "%1" msgstr "" "%1" "|/|" "$[accusative %1]" The part before |/| is the ordinary translation, the part after it is the scripted translation, as described here: http://techbase.kde.org/Localization/Concepts/Transcript Now, if the "Link to Application" and other template names were messages in native KDE4 POs, you would complete the construct by translating them as: msgid "Link to Application..." msgstr "" "=D0=A1=D1=81=D1=8B=D0=BB=D0=BA=D0=B0 =D0=BD=D0=B0 =D0=BF=D1=80=D0=B8=D0= =BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5..." "|/|" "$[properties accusative '=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D1=83 =D0=BD=D0= =B0 =D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5...']" The major problem here is that template names are stored in .desktop files, translated in desktop_*.po, which are "dumb", i.e. they do not accept scripted translations. This means that phrase properties have to come in another way. There are more ways to do this, and here is one rather complete (used since some time by the Croatian team, on my proposition). Instead of defining phrase properties through scripted translation, you define them in translator comments: # pmap: =3D/accusative=3D=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D1=83 =D0=BD=D0= =B0 =D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5.../ #: apps/lib/konq/Templates/linkProgram.desktop:2 msgctxt "Name" msgid "Link to Application..." msgstr "=D0=A1=D1=81=D1=8B=D0=BB=D0=BA=D0=B0 =D0=BD=D0=B0 =D0=BF=D1=80=D0= =B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5..." Then, from time to time you run this Pology sieve: $ posieve collect-pmap $BRANCH/l10n-kde4/ru -soutfile:$BRANCH/l10n-kde4/r= u/scripts/kdelibs/kdelibs4/general.pmap and commit the newly generated general.pmap. The kdelibs4.js mentioned above would be set to automatically pick it up. That completes this solution. collect-pmap sieve can do more as well, like check that there are no typos in form names (e.g. "acussative"); it's documentation can be reached from pology/doc/html/index.html, pology.sieve.collect_pmap node. (Side note: scripting calls and property names, even the pmap: prefix in the translator comment, all can be in Russian and Cyrillic, for extra style points.) (After all is done, your scripts/ subdirectory would look like: l10n-kde4/ru/ scipts/ kdelibs/ kdelibs4/ kdelibs4.js general.pmap This gets automatically included and installed by the language pack, no further intervention after committing is necessary.) The only thing you need from the outside is the precise content of kdelibs4.js. If the above seems workable for you, I would deliver it; basically a stripped down version of kdelibs4.js in Croatian (hr). (Well, you also need to check where "%1" filtering messages should be added in the code, and add them yourself or I could add them. Also necessary to ask the list for freeze break, even if "%1" are not very difficult messages to translate.) =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 --nextPart2940496.JEgU5LUM0f Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBMKI8RMSGXgigGr3ERAqV2AJ9/RB+W6Cf0p4F/KAbX4RmteHH4PwCfeQnx NG/0mkeATnS13uPnJ+Xdbjc= =glIg -----END PGP SIGNATURE----- --nextPart2940496.JEgU5LUM0f--