Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1139

pyside2-lupdate produces wrong language code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Won't Do
    • Affects Version/s: 5.13.2
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      This Problem happens in the following workflow:

      Qt Designer →pyside2-uic→ Python file →pyside-lupdate→ language file (.ts)

      If you convert your *.ui file via pyside2-uic to a *.py file, the function 'retranslateUi()' is auto generated. In this function all the translate statements are outofilled with the default values: translate(CONTEXT, KEY, None, -1).

      If you run the pyside2-lupdate command, a *.ts file is generated which context part looks like this:

      <context>
          <name>Name</name>
          <message numerus="yes">
              <location filename="filename.py" line="38"/>
              <source>English text</source>
              <translation type="unfinished">
                  <numerusform></numerusform>
              </translation>
        </message>
      </context>
      

      If you remove the last parameter in the translate statement (translate(CONTEXT, KEY, None)) the same part looks like this:

      <context>
          <name>Name</name>
          <message>
              <location filename="filename.py" line="38"/>
              <source>English text</source>
              <translation type="unfinished"></translation>
          </message>
      </context>
      

      That means the default value is not working properly, because if you leave it out, it leads to a different result in building the language file.

      The problem with this output is that with the 'numerus="yes"' option you have to add a plural form in Qt Linguist, otherwise an update with a new realease won't work. You always have to set everything to unfinished and confirm it once again (I observed this behaviour when the yellow ticks are present in Qt Linguist).

      So it would be nice if this problem could be fixed. I think it exists in the function 'translate' or in the parsing program 'pyside2-lupdate'

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              crmaurei Cristian Maureira-Fredes
              Reporter:
              johannes_r Johannes Roeske
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes