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

List:       kde-i18n-doc
Subject:    Re: File templates: menu item is also used as default file name
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2010-06-28 12:01:08
Message-ID: 201006281401.21395.caslav.ilic () gmx ! net
[Download RAW message or body]


> [: 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
.desktop 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 ""
  "Ссылка на приложение..."
  "|/|"
  "$[properties accusative 'ссылку на приложение...']"

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: =/accusative=ссылку на приложение.../
  #: apps/lib/konq/Templates/linkProgram.desktop:2
  msgctxt "Name"
  msgid "Link to Application..."
  msgstr "Ссылка на приложение..."

Then, from time to time you run this Pology sieve:

  $ posieve collect-pmap $BRANCH/l10n-kde4/ru \
-soutfile:$BRANCH/l10n-kde4/ru/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.)

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


["signature.asc" (application/pgp-signature)]

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

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