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
[Tools] Refactor updatets to support two-lang mods #5037
[Tools] Refactor updatets to support two-lang mods #5037
Conversation
@yorikvanhavre and @luzpaz can you have a look at this PR and see if this actually works to get the necessary translation strings? |
Yeah, that script evolved a lot over time... Good cleaning! Maybe we could simply remove the pyfolders list completely and let the script run both C++ and py gathering in all Mod folders? That way nobody has to worry about that anymore... |
If that doesn't break anything, then yeah, I think that's the best solution. I figured there was some reason we were so carefully avoiding running both lupdate and pylupdate on the same directory, but obviously we have some where we have to now. |
4c20726
to
def6d05
Compare
@yorikvanhavre OK, I just force-pushed another pass at refactoring the code. Because of the variability in the directory structures, I still ended up explicitly listing out all of the directories that need to be scanned, but at least now if a new one isn't being done, it will be obvious why! I run both lupdate and pylupdate on all of them, and just combine the results of each. I don't have a great way of testing whether this really worked, though. The TS files are generated, but I don't know what sort of havoc this will wreak on CrowdIn. |
@chennes we need to add I've started on Plot here, but it's not complete yet #5042 |
Plot is omitted here because it doesn't have a Resources/translations directory. That is probably most appropriately added in #5042. |
would you rebase the PR to make it run on CI? |
Following a link to the branch on the CI-repository: https://gitlab.com/berndhahnebach/FreeCAD/-/commits/PR_5060 The CI-status is available on the latest commit of the branch. https://gitlab.com/berndhahnebach/FreeCAD/-/pipelines?scope=branches |
The Crowdin build needs to be updated when this script is merged. For add ignored (or skipped) strings in FEM and other workbenches. |
FreeCAD CI-repository: pipeline: status: all pipelines for each branch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated files in 77925c4 Everything seems good! |
It does: that's the very first entry in the directories list, line 56. |
Ok! I was fooled because the script didn't change a line of the ts file, but that's good :) |
@yorikvanhavre new strings is not added to FEM workbench... Why is this happening? It seemed to me that after this pull-request is merged, translations of FEM workbench commands should have appeared. For example this (Constraint contact) not presented in Fem.ts:
and any other commands. |
The script to extract translation strings from source code files was designed to skip the C++ translations of directories with Python. In some cases this was manually worked around, but in others it was not. This PR is an attempt to refactor that code to ensure that both C++ and Python translations are included whenever a Mod has both languages in it.
./bin/FreeCAD --run-test 0