Final Report [Xliff Support for KBabel]

Asgeir Frimannsson asgeirf at gmail.com
Fri Sep 2 05:29:57 CEST 2005


Hi folks,

[Project Management]

  I've had roughly 6 full weeks to work on this project, and my
initial plan was as follows:
  1. Port KBabel to Qt4
  2. Design data model based on XLIFF
  3. Implement Qt4 model/view architecture around data model
  4. Implement Qt4 richtext editing widget for XLIFF data
  5. Integrate new data model with KBabel

As I'm not very familiar with Qt or C++ (coming from a Java/.Net
background), much of the time spent porting to Qt4 was spent on
learning Qt. I got Kbabel to run under Qt4 after around two weeks.

I spent the following two weeks digging into the XLIFF specification,
and looking at how we could redesign KBabel's Catalog class to model
the hierarchical and rich XLIFF format as opposed to the
string-table-like PO format. During the porting to Qt4, I realized
that trying to refactor the Catalog to model XLIFF was going to be
very hard, as basically everything in KBabel depends on the PO data
model. So I decided to create a new library, libkbxliff, modelling the
XLIFF specification as closely as possible. To summarize the model:
Each XliffDocument contains one or more XliffFile's, which in turn
contains the resources (XliffTransUnit, XliffBinUnit, XliffGroup),
which can be grouped in XliffGroup hierarchies where an XliffGroup can
contain zero or more XliffGroup, XliffTransUnit and XliffBinUnit
resources. A uml mockup is available at
http://xliff-tools.freedesktop.org/~asgeir/xliffmodel.png

(at this point I had a 3 week break catching up with family in Norway/Malaysia)

After implementing the libkbxliff library, I developed a Qt Model/View
model, with a hierarchical resource view and a xliff document
structure view.

At this point I decided not to work on the Qt4 port of KBabel, but
rather create a simple Qt test application. This because kdelibs is at
the moment just a port to Q3Support classes, so I found it a waste of
time to start developing for KDE4 when the KDE UI classes is bound to
change very soon. Much more fun developing with the new MainWindow
architecture for a test application :) So I created a new shared
library (libkbxliffui) containing the Model/View classes and the
customized widgets, and a test application (kbxlifftest), a simple MDI
application making use of libkbxliffui.

Finally, I added a Qt4 QTextEdit based widget to libkbxliffui, for
editing XLIFF data. This definetely needs more work, but demonstrates
how we can abstract inline codes in the widget.

..And then came September :) Over the next few months I plan to
refactor and improve what I've done so far, so that it can potentially
become the base for a next-generation localisation tool for KDE. At
the moment it's slow, has very limited functionality, and heaps of
bugs; but: it's a proof of concept of what can become something really
useful for KDE in the future :)

The code is available in /branches/kbabel-soc and uses unsermake to
build. You'll need a svn-version of unsermake, as i submitted a patch
last week for unsermake.

For a screenshot of the test app, see
http://xliff-tools.freedesktop.org/~asgeir/kbabel4.png

[Roadmap towards KDE4]

What I'd like to do next is to suggest we set up some kind of roadmap
towards KDE4. My suggestion is to continue the /trunk/ port of KBabel
so that it runs smoothly on qt4. We could then still provide the
good-old familiar kbabel on KDE4 for the hard-core PO translators, and
then in parallell work on creating a state of the art KBabel XLIFF
localisation tool.

When that is said, I know that your (kbabel developers) time is quite
constrained, so I'm not expecting any major contributions in the XLIFF
area at the moment - I guess I'll just have to show what I'm good for
over the next few months, that's how open source works :)

[Acknowledgments and Thanks]

Thanks to Stanislav, Nicolas and Thiago for all your helpful tips and
hints along the way. Same to all random people on #kde-devel and
#kde4-devel. Also thanks to the Red Hat engineering and localisation
team here Brisbane who kindly offered me internet connection and a
desk to work on when I was moving house and waiting for the adsl to be
reconnected :) Finally, thanks to Google for a brilliant SoC program
:)

cheers,
asgeir


More information about the Kde-soc mailing list