UI message formatting

Kai Willadsen kai.willadsen at gmail.com
Wed Mar 7 19:49:02 EST 2007


Hi,

I've been looking at the referencer dialogue code, and noticed that
the string formatting code uses C++-isms like:
    message = "Are you sure you want to remove '" + (*it)->getKey () + "'?"
and:
    progresstext << n << " of " << filenames.size() << " documents"
which, as I understand it, are less than awesome for translators, as
they assume english grammatical structures. The gtkmm site suggests
using either c-style sprintf formatting, or 'String composition
library' (http://people.iola.dk/olau/compose/). With the latter, you
get lines like:
    message = String::ucompose ("Are you sure you want to remove
'%1'?", (*it)->getKey ());
The 'library' is a single header file (well, two, but only one to do
ustring formatting), so it could be cut'n'pasted (LGPL) into the
current code.

So, is there interest in having the dialogue strings use a more
translator-friendly formatting method? and if so, which one?

--
Kai Willadsen



More information about the referencer mailing list