Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6-lupdate bug
Forum Updated to NodeBB v4.3 + New Features

PySide6-lupdate bug

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 299 Views
  • 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.
  • H Offline
    H Offline
    hizoka
    wrote on last edited by hizoka
    #1

    Hello,

    I guess I founded bugs with pyside6-lupdate command.

    Can you confirm it please ?

    With the command :

    pyside6-lupdate file.py -ts file.ts
    

    and as file.py :

    # ==
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    # ==
    

    I have the error :

    Updating 'file.ts'...
        Found 1 source text(s) (0 new and 1 already existing)
        Kept 1 obsolete entries
    Error: Contradicting source strings for message with id '='.
    
    while executing '/home/hizoka/.local/lib/python3.10/site-packages/PySide6/lupdate file.py -ts file.ts
    

    The problem are the #==.
    Is OK :

    # Only one =
    #=
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #=
    
    # Differents values before and after
    #==
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #===
    
    # Not = after the first #
    ##==
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    ##==
    
    # Not #== before
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #===
    
    # Not #== after
    #==
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    
    # A # alone after the 1 #==
    #==
    #
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #==
    
    # A # alone after the 2 #==
    #==
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #
    #==
    

    It's not OK :

    # With tr remplaces translation
    #==
    a = tr("a")
    b = tr("b")
    #==
    
    # With ' or " or """ or '''
    #==
    a = translate('''ErrorMessage''', '''a''')
    b = translate('''ErrorMessage''', '''b''')
    #==
    
    # With whatever char after #=
    #=@
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #=@
    
    # With lines between #= and commandes
    #==
    # ...
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    # ...
    #==
    

    And I founded a "better" bug, command never finishes without error message if a # finish the file :

    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #
    
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    # ...
    #
    
    # Or # odd
    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #
    #
    #
    

    If # is pair, it's OK

    a = translate("ErrorMessage", "a")
    b = translate("ErrorMessage", "b")
    #
    #
    

    Thank you

    pyside6-lupdate -version
    lupdate version 6.4.2
    
    1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on last edited by
      #2

      The #= comment has a special meaning for id-based translations . This is best avoided.

      1 Reply Last reply
      1

      • Login

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