Qt Linguist – nul points!

March 16th, 2007 by donnek Leave a reply »

I’ve just finished a translation of QCad, the 2D CAD program (see this page for a couple of screenshots). It’s a Qt program, so it uses ts-files instead of the gettext po-files. Qt supplies their own app (Qt Linguist) to deal with these.

The main “benefits” of ts-files are that they group messages into sections, which is supposed to make it easier to track down where your message should be showing up, and they use XML. But in my view, they are the most abominable things ever to be let loose on localisation.

Because the messages are split into sections, this means that if you use the same message in multiple areas of your app, you will get it appearing in multiple sections of the ts-file, and … yes, that’s right … it has to be translated multiple times. Qt Linguist has a section where previous translations (in that file!) have occurred, and you can press Ctrl + a number to copy them into the message, and then Ctrl + Enter to mark the message as “complete”. So for each repeated message you need two extra keystrokes before you can move on to the next using Ctrl + Shift + L. On a shortish file, this doesn’t matter, but when you have one that is longer than about 800 messages, it starts to grate. Oh, and you’ve just discovered you misspelt a word in one of the messages you were happily copying in to these duplicate messages … Now you have to find each one separately using Ctrl + F, and correct them. (I know you could do it via some sort of grep, if you are handy with grepping, but I wouldn’t trust it not to make changes where it shouldn’t, leading to even more edits.)

And XML … Well, once you get over about 1,000 items (and apps like Scribus have considerably more than that), you can just feel Linguist chomping it’s way through all that excess text – it can take 2-3 seconds just to go to the next item in a Find list. My biggest gripe about XML (apart from the one about not using it to hold data when there are far more efficient apps to do that – they’re called relational databases) is that it’s so wordy. For configuration files, and portable formats, it can be OK, but there are some types of data where the XML tags end up being probably 70% of the filesize (the tei-files for dictd – see this page) are an example.

So this is another case where the free software architects got it right with gettext – old-fashioned maybe (no XML), but very practical.

Leave a Reply