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. How are the Qt translation tools deriving these strings?
Qt 6.11 is out! See what's new in the release blog

How are the Qt translation tools deriving these strings?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 128 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.
  • Y Offline
    Y Offline
    Yuri Habadakas
    wrote last edited by
    #1

    We use the lupdate tool directly in our translation workflow. Very often, it will mark strings as "unfinished" when they do have valid translations.

    I was just checking these strings now, and noting that 90% of them are that we simply renamed or moved the source file in question. Ok, fair, Qt isn't 100% sure it's the same text.

    But there's also this case (for instance, in the German ts file):

    <message>
    -        <location filename="../src/SettingsDialog/SettingsPageInputLabels.cpp" line="480"/>
    -        <source>Done</source>
    +        <location filename="../src/SettingsDialog/SettingsPageInputLabels.cpp" line="492"/>
    +        <source>Save</source>
             <comment>Settings dialog accept button</comment>
    -        <translation>Fertig</translation>
    +        <translation type="unfinished">Speichern</translation>
         </message>
    

    In this case we changed the source text from "Done" to "Save". But how on earth does Qt know that it should translate "Save" as "Speichern"? Where did it get "Speichern" from?

    Christian EhrlicherC 1 Reply Last reply
    0
    • Y Yuri Habadakas

      We use the lupdate tool directly in our translation workflow. Very often, it will mark strings as "unfinished" when they do have valid translations.

      I was just checking these strings now, and noting that 90% of them are that we simply renamed or moved the source file in question. Ok, fair, Qt isn't 100% sure it's the same text.

      But there's also this case (for instance, in the German ts file):

      <message>
      -        <location filename="../src/SettingsDialog/SettingsPageInputLabels.cpp" line="480"/>
      -        <source>Done</source>
      +        <location filename="../src/SettingsDialog/SettingsPageInputLabels.cpp" line="492"/>
      +        <source>Save</source>
               <comment>Settings dialog accept button</comment>
      -        <translation>Fertig</translation>
      +        <translation type="unfinished">Speichern</translation>
           </message>
      

      In this case we changed the source text from "Done" to "Save". But how on earth does Qt know that it should translate "Save" as "Speichern"? Where did it get "Speichern" from?

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote last edited by
      #2

      @Yuri-Habadakas said in How are the Qt translation tools deriving these strings?:

      But how on earth does Qt know that it should translate "Save" as "Speichern"? Where did it get "Speichern" from?

      From other places where you used 'Save'

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

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

        Hi,

        Do you mean that your translation files contains Speichern or just that it is shown when running 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
        • Christian EhrlicherC Christian Ehrlicher

          @Yuri-Habadakas said in How are the Qt translation tools deriving these strings?:

          But how on earth does Qt know that it should translate "Save" as "Speichern"? Where did it get "Speichern" from?

          From other places where you used 'Save'

          Y Offline
          Y Offline
          Yuri Habadakas
          wrote last edited by
          #4

          @Christian-Ehrlicher right... I suppose that's why it marked it as unfinished in the .ts files, for the translators to confirm...

          Is it really as simple as it finding any random instance of the string being used before? I'm not surprised that it's guessed that (eg) the translation formerly in "src/Sidebar/CloudSyncLoginDialog.cpp" is the same as the one in the "new" "src/SettingsDialog/CloudLoginDialog.cpp" (when the file was simply renamed). But I am surprised that it's pulled a string for a totally new dialog which did not previously exist.

          @SGaist said in How are the Qt translation tools deriving these strings?:

          Hi,

          Do you mean that your translation files contains Speichern or just that it is shown when running your application ?

          The translation files. I have no reason to assume that's not shown in the application, but I haven't checked.

          Christian EhrlicherC 1 Reply Last reply
          0
          • Y Yuri Habadakas

            @Christian-Ehrlicher right... I suppose that's why it marked it as unfinished in the .ts files, for the translators to confirm...

            Is it really as simple as it finding any random instance of the string being used before? I'm not surprised that it's guessed that (eg) the translation formerly in "src/Sidebar/CloudSyncLoginDialog.cpp" is the same as the one in the "new" "src/SettingsDialog/CloudLoginDialog.cpp" (when the file was simply renamed). But I am surprised that it's pulled a string for a totally new dialog which did not previously exist.

            @SGaist said in How are the Qt translation tools deriving these strings?:

            Hi,

            Do you mean that your translation files contains Speichern or just that it is shown when running your application ?

            The translation files. I have no reason to assume that's not shown in the application, but I haven't checked.

            Christian EhrlicherC Online
            Christian EhrlicherC Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote last edited by
            #5

            @Yuri-Habadakas said in How are the Qt translation tools deriving these strings?:

            But I am surprised that it's pulled a string for a totally new dialog which did not previously exist.

            Why - it's a simple string compare and helpful for the translators.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            Y 1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @Yuri-Habadakas said in How are the Qt translation tools deriving these strings?:

              But I am surprised that it's pulled a string for a totally new dialog which did not previously exist.

              Why - it's a simple string compare and helpful for the translators.

              Y Offline
              Y Offline
              Yuri Habadakas
              wrote last edited by Yuri Habadakas
              #6

              @Christian-Ehrlicher said in How are the Qt translation tools deriving these strings?:

              @Yuri-Habadakas said in How are the Qt translation tools deriving these strings?:

              But I am surprised that it's pulled a string for a totally new dialog which did not previously exist.

              Why - it's a simple string compare and helpful for the translators.

              Well, I guess because it has no idea whether it's still valid in the context of the new location (and neither do I). But then again, I suppose that's why it marks it with unfinished, and that flag gets used by the Qt-native translation tools?

              (We use a different translation tool, and some scripts that convert the .ts files, and I only recently discovered this behaviour, and that the unfinished business wasn't being passed on by the conversion script!...)

              1 Reply Last reply
              0
              • Y Yuri Habadakas has marked this topic as solved

              • Login

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