Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Linguist - adding words manually.
Forum Updated to NodeBB v4.3 + New Features

Linguist - adding words manually.

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
10 Posts 3 Posters 2.5k Views 1 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.
  • ILI Offline
    ILI Offline
    IL
    wrote on last edited by
    #1

    Hi,
    How can I add manually words with translation into my .ts files?
    Not all the words locate in my code, and using update linguist is not enough.
    I need to add them staticlly. Anyway for doing that?

    I have parsing mechanism from external files (which are a json files) on my code with content of words that will appear on my screen and I need translation for them.

    Please advice,
    Best regards,
    IL

    1 Reply Last reply
    0
    • Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @IL said in Linguist - adding words manually.:

      I have parsing mechanism from external files (which are a json files) on my code with content of words that will appear on my screen and I need translation for them.

      Could you please give a more concise example of this use case? A screenshot would be great. Would your JSON file have both the word and translation for a particular language?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • ILI Offline
        ILI Offline
        IL
        wrote on last edited by
        #3

        Hi,
        The json file have only the original words which in my case is English, those words do not appear in the code, but I do need translation for them.
        I hope that this explain will clear my problem.

        Ilan

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

          Hi,

          Where are you getting these JSON file from ?

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

          ILI 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Where are you getting these JSON file from ?

            ILI Offline
            ILI Offline
            IL
            wrote on last edited by IL
            #5

            @SGaist Hi,
            The .json files are written by me, the purpose is be able to change screens without compilation, but this is not the point.
            Linguist give you the option to add translation only to text that locate in the code, I need option to add translation to text that will be generate during run-time.
            Can I add translation to a pre-known words into .ts files?

            IL

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

              Well yes it is, you seem to want dynamic text translation while having all possible translations statically built in your application.

              How are these texts going to be handled by your application ?

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

              ILI 1 Reply Last reply
              0
              • SGaistS SGaist

                Well yes it is, you seem to want dynamic text translation while having all possible translations statically built in your application.

                How are these texts going to be handled by your application ?

                ILI Offline
                ILI Offline
                IL
                wrote on last edited by
                #7

                @SGaist hi,
                These texts will be load to the code and will be display on demand.
                Each time that the user ask specific screen, the relevant text will appear.

                IL

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

                  Then why not provide your JSON in all required languages and use the appropriate one based on the language selection of your user ?

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

                  ILI 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    Then why not provide your JSON in all required languages and use the appropriate one based on the language selection of your user ?

                    ILI Offline
                    ILI Offline
                    IL
                    wrote on last edited by IL
                    #9

                    @SGaist I will do that or somthing similar if I don't have any other choice.
                    Do I have a choice?
                    Do I have the option to add translation for text that is out of the code?

                    IL

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

                      You could use ID based translation rather that text.

                      Another idea would be to have a source file using QT_TRID_NOOP but that you don't compile as part of your application.

                      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

                      • Login

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