[15:00] <roadmr> dpm: hello! sorry to pester you again, do you think https://bugs.launchpad.net/ubuntu/+source/checkbox/+bug/1044035 is ready for a veredict? or do you want to wait until I figure out how to add a comment as requested by Redmar?
[15:00] <roadmr> dpm: skaet has me on a deadline, hence why I'm bugging you so much :)
[15:01] <dpm> roadmr, don't worry, I'm used to bugging people, so I can truly understand it :-)
[15:01] <dpm> let me have a look
[15:03] <dpm> roadmr, if it's not too much work, I'd recommend adding the comment. it is just a matter of adding a comment line just above the translatable string in the code, and gettext will do the rest (i.e. it will extract it and put it in the .pot template, so that it is visible for translators in Launchpad)
[15:03] <dpm> E.g.
[15:03] <dpm> # TRANSLATORS: you're awesome!
[15:03] <dpm> print(_("This is a translatable string"))
[15:04] <roadmr> dpm: the code in question is a Qt .ui file :/ I'll do some research on how to achieve that
[15:08]  * roadmr experiments with shuttling comments from the .ui file to the auto-generated .c file
[15:11] <dpm> roadmr. I think you should be able to add comments in Qt Creator for the given string. As per putting the translatable strings from the .ui file to the .pot file, intltool should handle it, but you're using something else, I seem to recall
[15:11] <dpm> so unfortunately, I'm not sure I can help much :(
[15:12] <dpm> if it proves difficult and you're on a deadline, it's a lower priority item, I'd say, and you can leave it out
[15:15] <roadmr> dpm: no, we're using intltool, we managed to integrate with it :) and actually the Qt build process generates a .h file from which the strings are extracted, but I'd hate to have to maintain the .h file by hand
[15:16] <roadmr> dpm: I'll give QT Creator a quick try
[15:29] <dpm> roadmr, ok. I need to go now, but I'll be back online in 1 h or 2. Also feel free to e-mail me if I can help in anything, and I'll try to reply as soon as I can
[15:30] <roadmr> dpm: ok thanks! I'll wrestle with this for a bit, if I have no progress when you get back I'll let you know so we can maybe let this go through even without the comments
[15:30] <roadmr> dpm: thanks for your help :)
[15:30] <dpm> roadmr, sounds good
[16:33] <roadmr> dpm: hello :) ok, so I went looking and I found no way to add the comment from within the .ui file :/ it works if I add it to the auto-generated .h file but any change in the .ui will clobber that so it's not a sustainable approach :/
[16:40] <roadmr> dpm: I wonder if you'd agree to OK the exception, I'll continue to research on adding the comment anyway
[16:41] <dpm> roadmr, it sounds fine to me if it's difficult to implement or not doable in qt designer
[16:42] <roadmr> dpm: yep, it's not easy to do anyway :/
[16:42] <dpm> roadmr, actually, wait a sec, I see that in Qt Designer there is a field to add a comment, so we might be able to do it. Let me send you a screenshot
[16:43] <roadmr> dpm: yay! well I can add a comment directly in the xml file, it just doesn't get translated to something that intltool understands (i.e. an actual comment in the .h file that uic generates)
[16:48] <dpm> roadmr, looking at this screencap, the 'comment' will be added to the .ui file. Does it get ignored by whatever creates the intermediate .h file? http://ubuntuone.com/0o4PE2bqH3w7JncFDiStX4
[16:49] <roadmr> dpm: oh ok! I'll give it a try, but yes, I think that just gets added as disambiguation to the translate method call
[16:49] <roadmr> dpm: need to go for lunch (grumble), back in a bit!
[16:50] <dpm> roadmr, enjoy! ;) - you can also give a go at the 'disambiguation' field. I think one of them should generate a comment. Let me see if I can try it
[17:01] <dpm> roadmr, ok, it seems that only the 'disambiguation' field goes through to the generated .h file, but you're right, in a way intltool cannot parse:
[17:01] <dpm> label_2->setText(QApplication::translate("CalculatorForm", "Input 2", "This is a disambiguation", QApplication::UnicodeUTF8));
[17:02] <dpm> btw, out of interest, how do you feed the generated .h file to intltool to understand the Qt strings? Does it understand them without further processing?
[17:40] <roadmr> dpm-afk: in our build script we just ensure that uic-qt4 runs before intltool, intltool picks up the .h file and correctly extracts the strings
[17:49] <trijntje_> hi roadmr, did you see my request on the bug report to add a comment specifying the maximum length of translations?
[17:49] <roadmr> trijntje_: ah, you must be Redmar. Yes, I replied to it in the bug report. Short version: it's not easy to do :/ https://bugs.launchpad.net/ubuntu/+source/checkbox/+bug/1044035/comments/7
[17:51] <trijntje_> roadmr: ah, missed it, I'm sorry. No problem, don't spend too much time on it if it's difficult to do
[17:51] <roadmr> trijntje_: yes, apologies :/ Qt claims to have "great translation support", it's just not so easy to integrate with gettext toolchain, which is what the rest of checkbox uses :/
[17:54] <trijntje_> dont get me started on translating qt applications, I'm not a fan ;) But thanks for looking into it anyways
[17:54] <roadmr> no problem, thanks for your suggestions :)
[18:52] <dpm-afk> roadmr, to wrap this up, and unless you've already tested it, I'd suggest trying whether intltool picks up the 'disambiguation' comments as generated by qt designer and then put in the .h file by uic. If it does and they end up in the .pot file, then great, otherwise we can just leave it
[18:53] <roadmr> dpm: it doesn't, :(
[18:53] <roadmr> dpm: sorry :( I actually tested this by editing the xml by hand and adding a "comment" attribute to the qlabel, the disambiguation thing goes in, but intltool ignores it :(
[18:57] <dpm> roadmr, ah, bummer :( thanks for trying anyway
[18:57] <roadmr> dpm: yep :/ we'll try to fix this in a better way at some point
[18:59] <dpm> np
[18:59] <roadmr> dpm: don't forget to comment on the bug so skaet is happy when the merge request hits :0
[19:02] <dpm> roadmr, done
[19:03] <roadmr> dpm: thanks, much appreciated :) apologies for all the pestering
[19:03] <dpm> roadmr, that wasn't pestering, always glad to talk about how to better localize the desktop :)
[19:04] <roadmr> dpm: well we still have work to do on checkbox, some is Qt-related and we have an outstanding task to improve how our rfc822 files are handled, luckily I always get great help here :0
[19:04] <roadmr> er, :)