Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Different languages in UI and application output
Forum Updated to NodeBB v4.3 + New Features

Different languages in UI and application output

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 354 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • FlincoF Offline
    FlincoF Offline
    Flinco
    wrote on last edited by
    #1

    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() not translate() provide any argument for specifying the translation language.

    Is there any facility for accomplish this?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • FlincoF Offline
        FlincoF Offline
        Flinco
        wrote on last edited by Flinco
        #3

        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).

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • FlincoF Offline
            FlincoF Offline
            Flinco
            wrote on last edited by
            #5

            Such implementation was my plan B. But at this point I belive that I will do just like that!

            Thank you for the clarification and suggestion.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved