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

List:       kde-i18n-doc
Subject:    Re: KUIT "@action:undo" for QUndoCommand
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2011-05-12 13:44:01
Message-ID: 201105121544.04227.caslav.ilic () gmx ! net
[Download RAW message or body]


> [: Alexander Potashev :]
> What do you think about using KUIT "@action:undo" in context for strings
> passed to QUndoCommand?

There are three problems with this.

The first problem is that KUIT markers are supposed to tell the translator
where in the user interface the string appears, so that the translator can
apply those translation guidelines which refer to user interface context
("use imperative verbs for button texts", "use noun syntagmas in window
titles", etc.) The definition "strings passed to QUndoCommand" is non-
conformant in that sense, as it does not describe where the string is shown
in the UI.

The second problem is that it is insufficient on its own, because texts in
undoing context are sometimes not explicitly set. You mentioned Krita, take
for example the "Fill with Foreground Color" message: in the UI, it appears
in the Edit menu, therefore its context should be "@action:inmenu Edit"; in
the code, it is passed to KAction constructor. But, this string will also
appear in "Undo <action>" menu item after the action is performed. Or, take
the "Lens Blur" message, which in the code is simply the name of a filter
(not directly passed to any object in particular) but still appears in "Undo
<action>" after the filter is applied. This example also shows that the
string in undoing context doesn't have to be originally an action at all.

The third problem is that you would like this context marker also to tell
you that you can use the new double-form functionality of QUndoCommand,
which it cannot as such. What if some other kind of undo stack is used? It
doesn't matter how probable this it, what matters is that context markers
must not be linked to underlying functionality of particular classes. In
other words, when I see @action:undo, I would not be free to assume that I
can use the double-form translation.

We could ignore the second problem, i.e. whether a formal context for
explicit QUndoCommand texts is worthwile given the variety of strings that
implicitly find their way into undoing contexts. The first and the third
problem cannot be ignored.

I would instead propose the following context for QUndoCommand texts:

  "... (qtundo-format) ..."

It is only important to put the (qtundo-format) keyword anywhere in the
context, and there is no formal connection with KUIT. We already did this
once, look for (qtdt-format) keyword in contexts in plasma-something. The
*-format part is there because this is essentially that, a special string
format. (I think these keywords should become proper Gettext flags in
perspective, recognized and extracted by xgettext from a comment preceding
the message, as is currently the case with no-*-format flags.)

-- 
Chusslove Illich (Часлав Илић)

["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