Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FreeCAD-addons] - Maintainers should NOT use pylupdate5 to update translation files #297

Open
2 tasks done
hasecilu opened this issue Mar 1, 2024 · 4 comments
Open
2 tasks done

Comments

@hasecilu
Copy link

hasecilu commented Mar 1, 2024

In my journey translating WB I have encounter cases were some strings are not included on the .ts file.

As Chris reported some time ago black formatted code wasn't being picked by lupdate, a fix was made back then and in FreeCAD code was good again but somehow it looks that this problem is still present on external WB.
https://forum.freecad.org/viewtopic.php?t=65744

With this in mind when I added translation support on FreeGrid, Gears, SheetMetal, Assembly3 and Assembly 4 (WIP) I used pylupdate6 in the scripts. I tried to do the same on Fasteners but it seems that there the code is not formatted and pylupdate5 works fine, I tried to use pylupdate6 but it gets error for some code.

Reading on the issues here it seems that this is a recurring problem so maybe we can track issues related to this, the solution is to use pylupdate6.

Maintainers would be interested on this script that have helped me to fix this problem: #296

On my Arch Linux system pylupdate6 is a mini script. I don't know about other systems maybe someone check that.

$ file /usr/bin/pylupdate6
/usr/bin/pylupdate6: POSIX shell script, ASCII text executable
$  cat /usr/bin/pylupdate6
#!/bin/sh
exec /usr/bin/python -m PyQt6.lupdate.pylupdate ${1+"$@"}
@chennes
Copy link
Member

chennes commented Mar 1, 2024

What error are you getting from lupdate6? We use it exclusively on FreeCAD main, for the reasons you link to.

@hasecilu
Copy link
Author

hasecilu commented Mar 1, 2024

What error are you getting from lupdate6? We use it exclusively on FreeCAD main, for the reasons you link to.

From lupdate6 none, the problem is when external WB uses lupdate5 and that makes strings are not marked and thus translation is not completed, here I'm tracking WB that have this problem

@hasecilu hasecilu changed the title Maintainers should not use pylupdate5 to update translation files [FreeCAD-addons] - Maintainers should NOT use pylupdate5 to update translation files Mar 1, 2024
@chennes
Copy link
Member

chennes commented Mar 1, 2024

I should note that "pylupdate6" is not the official Qt6/PySide6 executable -- we do not use it for FreeCAD main, we use Qt6's lupdate tool, which directly supports Python code now. That may not be relevant here, I'm just pointing it out for posterity.

@hasecilu
Copy link
Author

hasecilu commented May 27, 2024

What error are you getting from lupdate6? We use it exclusively on FreeCAD main, for the reasons you link to.

I just realized I explicitly said there was a problem with pylupdate6 and then said no. I meant not problems in general but a specific problem in Fasteners WB.

Today I investigated the problem and solved it, the explanation is in point 2 on shaise/FreeCAD_FastenersWB#384

Could be a regression on upstream? because pylupdate5 worked fine but pylupdate6 gave the error.

Anyway, I'll test with lupdate to see if it's a 1 to 1 replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants