Use of tr/i18n/QApplication::translate in tier1/2 frameworks

David Faure faure at kde.org
Wed May 1 19:35:13 UTC 2013


On Tuesday 30 April 2013 19:02:40 George Goldberg wrote:
> There's a task in the kdelibs_cleanup epic that's been assigned to me for a
> few months, namely using the correct method call for translatable strings
> in tier1/2 frameworks where ki18n isn't available.  Way back, I changed
> them all to QCoreApplication::translate with no context, which at the time
> was considered the "correct solution", but almost as soon as it was done it
> became apparent that this wasn't necessarily the correct solution and we
> should wait until it became apparent what the correct solution was before
> proceeding.
> 
> Since then, the task on the wiki has been updated to say "use tr()".  I'd
> like to get that task finished if possible, so my question is, was a
> consensus ever agreed on what is the way to proceed, and if so, what was
> it, and if not, could anyone with ideas about this please weigh in?

Yes, IIRC the conclusion was: the empty context is not necessary, we can use 
.po files with standard usage of tr() -- the context can simply be stored as a 
comment in the .po file, during .ts -> .po -> .ts conversions, so you can port 
to tr(), indeed.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list