Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135828

Recommend explicit translation context

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Tools: Linguist
    • None
    • tr-context

    Description

      The documentation and examples so far recommend using an automatic translation context for non-id-based translations:

      • For C++, this is typically the name of the QObject subclass
      • For .ui files, it is the class name
      • For QML, it is the file name

      Anyhow, this automatic context is often a poor approximation of the semantic context:

      • Class and form names are often very technical, not actually giving translators much hints
      • Parsing e.g. C++ for deriving the correct context at runtime is complex and error prone
      • They are often too fine-grained, leading to lots of contexts with little text, hammering translation reuse
      • Just renaming classes and files will lead to outdated translations

      We should steer users away from relying too much on the automatic context:

      • For QML, you can use pragma Translator on a file level
      • For C++, e.g. Qt Creator adapted a pattern to define an explicit context on plugin level

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kkohne Kai Köhne
            kkohne Kai Köhne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes