From kde-i18n-doc Thu May 12 15:41:15 2011 From: Alexander Potashev Date: Thu, 12 May 2011 15:41:15 +0000 To: kde-i18n-doc Subject: Re: KUIT "@action:undo" for QUndoCommand Message-Id: X-MARC-Message: https://marc.info/?l=kde-i18n-doc&m=130523164920539 2011/5/12 Chusslove Illich : >> [: 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 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 Those 2 strings come from different i18n() call, so we can just "split" them by adding a context to one of them. > appear in "Undo " 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 > " 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. Usage of "Lens Blur" is probably a bit hacky. If one string go not only to QUndoCommand, I would prefer keeping it without "(qtundo-format)" to not confuse translators. > 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 "(qtundo-format)" make sense here. > 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. But regardless of what exactly you put in the context ("@action:undo" or "(qtundo-format)"), you'll need to keep track on particular applications' dependencies (whether they depend on Qt 4.8+ or an older version). > I would instead propose the following context for QUndoCommand texts: >  "... (qtundo-format) ..." Thanks for the idea, will replace "@action:undo" with "(qtundo-format)". This fixes the first problem from your list. Is there or will there be a list of "(qtdt-format)" and friends like http://techbase.kde.org/Development/Tutorials/Localization/i18n_Semantics ? -- Alexander Potashev