[kde-russian] "Magic split" for undo action names available in Calligra
Alexander Potashev
aspotashev на gmail.com
Чт Июн 23 18:20:13 UTC 2011
Hi,
Two days ago I patched the whole Calligra to use my library kundo2
instead of Qt Undo Framework for undo actions. This makes the
following two features effectively available (i.e. the patches for
Calligra are different that for Qt, of course) in Calligra without
need to wait for Qt 4.8:
1. https://qt.gitorious.org/qt/qt/merge_requests/1212
2. https://qt.gitorious.org/qt/qt/merge_requests/2610
The second feature ("magic split") makes possible different
translations of undo actions in the context of "Undo %1"/"Redo %1"
menu commands and in the context of Undo History widget. If you are
not interested in this, you can just ignore this new feature and
everying would work exactly like before. Also, you can use "magic
split" for some messages and not use it for other messages.
If you want to use "magic split" for a string, instread of one
translation you should write two different translations separated by a
"\n" in the translation field in Lokalize or other PO editor (or
"msgstr" field). The first part (before "\n") goes to the Undo History
widget, the second part (after "\n") goes to "Edit -> Undo %1" and
"Edit -> Redo %1" menu commands.
Example: (in krita.po)
msgid "Brush"
msgstr "Кисть\nрисование кистью"
"Кисть" will be the name of an item in "Undo History" widget, and the
menu commands under "Edit" will be "Отменить рисование кистью" and
"Повторить рисование кистью" (Отменить/Повторить are Russian
translations of Undo/Redo).
If there is no "\n" in the string, the same translation will be used
in both cases.
Before using "magic split" you should ensure that the string is _only_
passed as undo command text to KUndo2Command (or a derived class).
It would be nice to add a "(qtundo-format)" context to all such
strings, but I'm not sure if I can do that soon in the whole Calligra.
But if those would be added, make your "unfuzzy_context_only" Pology
sieves ready ;)
Note that for now you can only use "magic split" in Calligra, do not
try using it in translations of other applications.
Previous discussions about "magic split":
1. http://lists.kde.org/?t=130375522600002&r=1&w=2
2. http://mail.kde.org/pipermail/calligra-devel/2011-May/001455.html
--
Alexander Potashev
Подробная информация о списке рассылки kde-russian