Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Brainstorm
  4. Changing Translator source text affects all translation files
Qt 6.11 is out! See what's new in the release blog

Changing Translator source text affects all translation files

Scheduled Pinned Locked Moved Brainstorm
3 Posts 2 Posters 2.0k 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.
  • J Offline
    J Offline
    JosuéCarrillo
    wrote on last edited by
    #1

    Hi there,

    I’m developing an application that needs to be translated to different languages, so I started using the translator syntax tr(“source text”); and that works pretty good translating to all languages. The problem that I see is when the “source text” needs to be changed, because all translations are referenced to this “source text” and this reference will not exist anymore.

    For example:
    I have a button with the German text “Schließen” and it has been translated into English “Close” and Spanish “Cerrar”. Then it was decided that the source text in German should be changed to “Beenden” but the English and Spanish text stay the same. After this change, loading the translations (English or Spanish) will fail to translate this button because its reference doesn’t exist and the changed text needs to be translated again in all languages…

    I am thinking about using keywords as source text, for example tr(“STR_CLOSE”); so that single changes are done directly in the .ts file and not in my code, and all the translations are referenced to this keywords that doesn’t need to be changed. But since I don’t have much experience with translations I am asking for some advice.

    Thanks!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      The general advice is to always write all the strings in the source code in English.

      As for your case: this is understood. The translation system has no way of knowing that "Schliessen" and "Beenden" mean the same thing, so it treats it as a complete change. There is not really any way around this, with the exception of translating the software after it is released/ string frozen (then you can be certain that the string will not change).

      Your idea with keywords is valid, but seems like too much work. And it would make the job of translation team much harder (right now they can simply translate what they see into their language. With keywords, they would first need to check what does the keyword mean, and then translate that).

      (Z(:^

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JosuéCarrillo
        wrote on last edited by
        #3

        Thanks for your reply

        I will follow your advice and keep all sources in English. Assuming that in most of the cases a change in source code also implies a change in other languages the the use of keywords doesn't bring much advantage...

        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