Different languages in UI and application output
-
I wrote a QtWidget application that computes race rankings.
Its output is a set of PDF files containing the computed rankings.The application UI is displayed in English or in my own country language, basing on the current locale. Let's call this language langUI.
At present time the rankings are translated into the same language of the UI.
I would like to add a combo box that allows the user to select the language in which the rankings will be printed on the PDFs. Let's call this second language langPDF. The selection of langPDF should not change the UI language at all.
The solution of loading the langPDF translation before building the PDF and unloading it at the end, has an unacceptable drawback: any debug, info, warning and error messages produced in the meantime is translated to langPDF too. But all these messages are shown by the UI, so they should be produced in langUI.
It seems that neither
tr()
nottranslate()
provide any argument for specifying the translation language.Is there any facility for accomplish this?
-
Hi and welcome to devnet,
To the best of my knowledge, no.
That said, what do you mean by info, debug, warning and error messages ? Those sent to stdout ?
If so, why are you translating them ? That's typically the kind of message that is for the developer and if a user gets to send a log back to the developer, it would make more sense to have them in a single language so there's no need to go back and forth to understand what has happened.
-
Hi,
my app does not print on stdout or stderr.debug is an oversight; no debug message is displayed.
With info, warning and error messages I mean strings that give feedback to the user (in specific text boxes) about:
- the consistency of the input data
i.e. timings associated to non existent bibs, more timings that the allowed legs, etc... - the activity of the application
i.e. that the PDFs have been generated successfully and in which directory, that the input data are not consistent and that no PDF has been generated, etc...
I think that it would be not "pleasant" to have these messages in English while the UI is in Italian (or vice-versa).
- the consistency of the input data
-
One thing that comes to mind would be to change the language, do the printing operations, buffer all the possible informations/issues, switch the language back and then show the informations.