Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63532

Support Qt translation files

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We are using this Tool already for different linter (thanks for the work @uhafner ). But currently we are working on the translation files and in a lot of PRs the adjustments are missing. So my first idea was to create a parser and transform the translation file into any other parser format this plugin likes. But as the format is really simple any maybe other user could use it to and transformation via CMake script is not such easy (due to limited regex capability), it would be nice if this plugin can this format directly.

      The formal format description is [here|https://doc.qt.io/qt-5/linguist-ts-file-format.html.]

      Example file:

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE TS>
      <TS version="2.1" language="de_DE">
      <context>
          <name>TranslatedObject</name>
          <message>
          <message>
              <source>UndefinedClass</source>
              <translation>Undefiniert</translation>
          </message>
          <message>
              <source>Other</source>
              <translation>Sonstiges</translation>
          </message>
      </context>
      <context>
          <name>TranslatedObjectWithPlurals</name>
          <message numerus="yes">
              <source>%n Warning(s)</source>
              <translation>
                  <numerusform>%n Warnung</numerusform>
                  <numerusform>%n Warnungen</numerusform>
              </translation>
          </message>
          <message numerus="yes">
              <source>%n Error(s)</source>
              <translation>
                  <numerusform>%n Fehler</numerusform>
                  <numerusform>%n Fehler</numerusform>
              </translation>
          </message>
          <message numerus="yes">
              <source>%n Info(s)</source>
              <translation>
                  <numerusform>%n Information</numerusform>
                  <numerusform>%n Informationen</numerusform>
              </translation>
          </message>
      </context>
      <context>
          <name>TranslationHints</name>
          <message>
              <source>Help</source>
              <translation type="unfinished"></translation>
          </message>
          <message>
              <source>Language</source>
              <translation type="unfinished">Sprache</translation>
          </message>
          <message>
              <source>Exit</source>
              <translation type="vanished">Beenden</translation>
          </message>
          <message>
              <source>Update</source>
              <translation type="obsolete">Aktualisieren</translation>
          </message>
          <message numerus="yes">
              <source>%n Debug(s)</source>
              <translation type="unfinished">
                  <numerusform></numerusform>
                  <numerusform></numerusform>
                  <numerusform></numerusform>
              </translation>
          </message>
      </context>
      </TS>
      

      So the plugin should scan for all `translation` tags, which contains a `type` field (the other can be ignored). Severity for all 3 possible types/categories (`unfinished`, `vanished`, `obsolete`) could be always normal, as it is never critical if something is not translated.

      Even there exists a `location` tag (a `message` can contain multiple `location` tags) I would ignore it and reference only the line in the XML file, as the issue is within the XML file and not within the code and the `location` is an optional field.

      Sorry, I have no Java development environment on my PC, otherwise I would write the extension myself :-/.

        Attachments

          Issue Links

            Activity

            sunblack sunblack created issue -
            Hide
            drulli Ulli Hafner added a comment -

            Typically new parsers are contributed by volunteers.

            Show
            drulli Ulli Hafner added a comment - Typically new parsers are contributed by volunteers.
            drulli Ulli Hafner made changes -
            Field Original Value New Value
            Assignee Ulli Hafner [ drulli ]
            Labels help-wanted
            Hide
            drulli Ulli Hafner added a comment -

            Seems that no one is willing to provide a PR.

            Show
            drulli Ulli Hafner added a comment - Seems that no one is willing to provide a PR.
            drulli Ulli Hafner made changes -
            Resolution Postponed [ 6 ]
            Status Open [ 1 ] Closed [ 6 ]
            drulli Ulli Hafner made changes -
            Assignee sunblack [ sunblack ]
            drulli Ulli Hafner made changes -
            Remote Link This issue links to "PR #546 (Web Link)" [ 26427 ]
            Hide
            drulli Ulli Hafner added a comment -

            A followup PR Is required in the warnings plugin to register the parser.

            Show
            drulli Ulli Hafner added a comment - A followup PR Is required in the warnings plugin to register the parser.
            drulli Ulli Hafner made changes -
            Resolution Postponed [ 6 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            Show
            drulli Ulli Hafner added a comment - Example: https://github.com/jenkinsci/warnings-ng-plugin/pull/729
            drulli Ulli Hafner made changes -
            Remote Link This issue links to "v8.6.0 (Web Link)" [ 26433 ]
            drulli Ulli Hafner made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Fixed but Unreleased [ 10203 ]
            drulli Ulli Hafner made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]

              People

              Assignee:
              sunblack sunblack
              Reporter:
              sunblack sunblack
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: