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. ts_tool - Utility for extracting strings from .ts files for translation services.
Forum Update on Monday, May 27th 2025

ts_tool - Utility for extracting strings from .ts files for translation services.

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 1 Posters 2.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.
  • N Offline
    N Offline
    nen777w
    wrote on last edited by nen777w
    #1

    Let me introduce a small utility for extracting strings from .ts file into .txt file.

    It need for example for translation services which is get the text files in format: one string - one translation and then distribute this string's between translators for speed up the translations.

    The idea in following (.ts -> .txt):
    Command line:

    ts_tool.exe --src v:\PROJECTS\CODIJY\ColorMagicGUI\translations\ColorMagic_EN.ts --dst t:\test\ --mode TXT

    The utility take input .ts file, parse it with priority for <translation> tag (if <translation> is empty it use the <source>) and generate two files on output:

    • .ts file with hash's
    • .txt file in format [hash] "String for translation"

    i.e. for example .ts:
    ...
    <message>
    <location filename="../shortcuts/shortcut_manager.cpp" line="30"></location>
    <source>Arm Tool</source>
    <translation>[08F5B2DC]</translation>
    </message>
    ...

    .txt:
    ...
    [08F5B2DC] "Arm Tool"
    ...

    Then you can send .txt file for translation.
    After translation for insert translated strings back to .ts file use this command:

    ts_tool.exe --src t:\test\ --dst v:\PROJECTS\CODIJY\ColorMagicGUI\translations\ColorMagic_EN.ts --mode TS

    Git Repo: https://github.com/nen777w/ts_tool.git

    1 Reply Last reply
    1
    • N Offline
      N Offline
      nen777w
      wrote on last edited by
      #2

      Update ts_tool to v2.0
      Whats new:
      Add mode: --with-unfinished for include unfinished records to result .txt file,
      and: --with-vanished for include obsolete records to result .txt file.
      Rename mode XML to TS

      Sources: https://github.com/nen777w/ts_tool.git

      1 Reply Last reply
      1
      • N Offline
        N Offline
        nen777w
        wrote on last edited by
        #3

        Updated to 2.3
        Utility adapted and tested for gengo.com

        Unfortunately gengo.com don't give me any discount, but I allow him use it for free.
        Binary and sources here: https://github.com/nen777w/ts_tool.git

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nen777w
          wrote on last edited by
          #4

          Update to v2.5
          https://github.com/nen777w/ts_tool

          1 Reply Last reply
          2
          • N Offline
            N Offline
            nen777w
            wrote on last edited by
            #5

            Update to version 2.6
            With a new option: "--unfinished-only" (Useful if need to translate only new or updated records).

            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