Discussion:
UI message formatting
Kai Willadsen
2007-03-08 00:49:02 UTC
Permalink
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
John Spray
2007-03-08 08:53:38 UTC
Permalink
Post by Kai Willadsen
So, is there interest in having the dialogue strings use a more
translator-friendly formatting method? and if so, which one?
The compose library looks like the Right Answer(tm), so I have checked
it into svn and updated readme/makefile appropriately. I tried using it
in the onDeleteTag function and it seems to work fine. Converting all
the rest of the messages will be something for a rainy day :-)

John
Kai Willadsen
2007-03-08 11:00:19 UTC
Permalink
Post by John Spray
Post by Kai Willadsen
So, is there interest in having the dialogue strings use a more
translator-friendly formatting method? and if so, which one?
The compose library looks like the Right Answer(tm), so I have checked
it into svn and updated readme/makefile appropriately. I tried using it
in the onDeleteTag function and it seems to work fine. Converting all
the rest of the messages will be something for a rainy day :-)
I have a patch that converts most of the messages and cleans up some
of the dialogue logic as well. I'll clean it up and send it in
shortly.

Kai

Loading...