[Qt-interest] Handling translations in a multi-threaded server
Konrad Rosenbaum
konrad at silmor.de
Thu May 19 12:41:52 CEST 2011
On Thu, May 19, 2011 10:35, Tony Rietwyk wrote:
> I have multi-threaded servers that handle database queries from
> potentially many clients in many different countries (especially the
> European server). The requests are processed via a thread pool. Each
> request has the locale code for the translation file to be used by the
> IBase sql driver.
>
> The problem is that the IBase driver calls QApplication::translate for
> errors. This implies all threads have to use the same translation file.
>
> How have others worked around this limitation?
I haven't done this yet, but I would pre-load QTranslator objects for all
languages, NOT install them in the QApplication object, and then call
QTranslator::translate with the untranslated string from the IBase driver.
I hope this wasn't too confusing...
Konrad
More information about the Qt-interest-old
mailing list