PySide6-lupdate bug
Unsolved
Qt for Python
-
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
-
The #= comment has a special meaning for id-based translations . This is best avoided.