Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Howto export all texts to translate with QLinguist?
QtWS25 Last Chance

Howto export all texts to translate with QLinguist?

Scheduled Pinned Locked Moved Qt Creator and other tools
13 Posts 7 Posters 12.2k Views
  • 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.
  • J Offline
    J Offline
    jingo
    wrote on last edited by
    #1

    Hi guys,

    Could anyone help about the question as said by title?
    It'd better export texts in a text file or something as that...
    Thanks a lot,

    Jing

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      Not 100% sure what you're asking, but running lupdate on your code will generate the translation file that lingust reads, which is XML. You can always parse that if you need the information in some other format.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jingo
        wrote on last edited by
        #3

        I appreciate your reply.
        I am trying to list all texts(within tr) in source codes, and d like to find out a way to get the list quickly.
        Does Qlinguist tool offers this functionality to export these texts in an excel file for example?

        Thanks,

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Did you not read mlong's reply? Did you try the lupdate tool?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jingo
            wrote on last edited by
            #5

            Yes I read it, and appreciate his kind reply.
            I use lupdate tool, it just update my ts file, which can of course be opened on XML format.
            All I ask is just can Qlinguist(after opening the ts file) export all texts in an excel or not?
            Maybe it was my question which is not clear enough,
            Does anyone know about it?
            Thanks,

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lgeyer
              wrote on last edited by
              #6

              [quote author="jingo" date="1331897573"]All I ask is just can Qlinguist(after opening the ts file) export all texts in an excel or not?[/quote]
              I don't think so.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                No, it cannot. Why would it need to export to Excel?
                However, perhaps Excel can just import the .ts file? It is just XML after all...

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jingo
                  wrote on last edited by
                  #8

                  I see...
                  Thanks a lot!

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #9

                    Or better: write your own converter, that reads the XML and creates an Excel file for you.

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • E Offline
                      E Offline
                      ermebelinda
                      wrote on last edited by
                      #10

                      hello,
                      what do you mean with "write your own converter"? I am trying to export the source text in excel and I get an xml file. How can I just get the content to translate? Is there a way to parse XML file to isolate useless tags?
                      What do you think?
                      Linda

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andre
                        wrote on last edited by
                        #11

                        Sure: a bit of C++ code to parse the .ts file will do the trick just fine. Qt has some pretty good XML parsing classes. I just did something like that to auto-replace some strings in the translations. Took an hour or two all in all.

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          ermebelinda
                          wrote on last edited by
                          #12

                          hello, thanks for the reply.
                          I have another question. Is it possible to create a phrasebook automatically? I mean: is it possible to insert all segments in it at once?

                          1 Reply Last reply
                          0
                          • mwallnoeferM Offline
                            mwallnoeferM Offline
                            mwallnoefer
                            wrote on last edited by
                            #13

                            The best way is to use Excel's integrated XML support as described here: [https://www.nextofwindows.com/how-to-convert-excel-spreadsheet-to-json](link url).

                            First create an XML map by using a small TS file to let Excel know how to interpret the Qt Linguist format. Finally import the data by mapping the XML elements to the worksheet columns and then by choosing the Import... option in the cell's XML context menu.

                            One additional note: Remove all <!DOCTYPE TS> declarations from the TS files, otherwise Excel denies the import with "unsupported document type".

                            1 Reply Last reply
                            1

                            • Login

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