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
Automate push/pull translations from Crowdin #107
Comments
Technologically this is straightforward: in fact, anyone with the appropriate level of access could do it right now with just a few lines of bash shell script. I don't have the right CrowdIn rights, so it can't be me. I guess that leaves it to @yorikvanhavre ? We can also automate the git end of things, though it might be best to create a new Git account similar to what I did for the Mantis bug import, rather than having the commits tied to an individual developer. If we really wanted to we could run this sort of thing as a cloud process someplace, but that's probably overkill. |
Crowdin level scripts can only be executed by project managers. Currently there are 6 chosen ones. |
Yes, please automate this process. A very short round trip time is essential for efficient development. A script that makes it possible to update and test translations locally before committing any changes to Github or Crowdin would be a very welcome addition. See FreeCAD/FreeCAD#9275 for some additional comments. |
I don't think the system envisioned here is of that much use to translators in terms of making a shorter round-trip: we're talking here about something that is run on the order of weekly and serves to add predictability to when translations are available to end users. I think there are two other groups of people with different automation needs. First, developers who are modifying the source code to enable/fix translation problems. For them, you really want to bypass the CrowdIn upload/download entirely: all a developer cares about is, given a change to the source code:
This doesn't need CrowdIn at all, it needs a script that runs lupdate locally, verifies that some expected context/string is present, generates some kind of dummy language file, injects a fake translation string into it, and processes to a *.qm file. Then the UI can be examined for the presence of this string. I suspect translators have a different need: given a (real) translation string, what does it look like in the UI? So pull down new CrowdIn data, process it, apply it, and make it available to FreeCAD at runtime. Does this fit with your understanding? |
Hi Chris Thank you very much for your additional comment. You are right, there are at least two different groups of contributors to i18n/L10n:
As you already mentioned, translators could profit from a helper script that downloads and applies all translations that are provided in Crowdin at this very moment. This way they could more or less instantly check how a new or updated translation looks on screen and improve things right away. Developers already have a very short round trip time because they can change, compile and run everything on their local machines. The "interesting" group is now the intersection: developers who work on i18n/L10N. For this group the situation is still a bit awkward and this is the group I ended up in very shortly after my first steps contributing to FreeCAD. :-) A typical workflow would look like this:
As long as Crowdin is the single source of truth wrt L10N, the workflow above most probably must make sure to ignore all local changes to the *.ts files. What do you think? Does that sound reasonable? |
Your proposed workflow is completely possible right now: we have a helper script to run lupdate on the entire package (updatets.py), and we have a script that runs lrelease (updatecrowdin.py). Everything else is just normal compilation workflow up to step 6b (update your translations on CrowdIn -- I don't know how to do that from the local translated ts files). |
I don't see how I can use both scripts right now to get to the proposed workflow. As far as I can see, The script |
Doesn't step 3 in your process above create/modify the locale-specific TS files? I normally do it by hand, not with QtLinguist, but I imagine it's much the same process either way. Then I manually run lrelease on the file I am working on to generate the QM, then I recompile FreeCAD. |
While I can modify locale-specific *.ts files with Qt Linguist or by hand, the strings that got changed or added in the source files in step (1) are still missing. The locale-specific *.ts files are completely untouched after running the current version of |
@yorikvanhavre Take a look at this GitHub CI integration workflow: https://github.com/crowdin/github-action What do you think about setting it up to run once per week? Or maybe even more? |
I don't know anything about what happens when you run lupdate on those files: we always generate them from CrowdIn. Does lupdate simply add the missing strings? |
Yes that would be fine. For me before doing this, there is one preliminar step we should achieve: Remove the qm files entirely from the source, and build them at build time. When that is working, then we can set up a crowdin integration. That would indeed offload parts of the work and make merges more predictable. But indeed that still leaves us with one manual part, that is to regenerate the base ts files. For this I don't see much what we can do to automate. |
QM file building can also be done in a script. I wonder how I could have missed such an important discussion. 🤨 |
Building qm files automatically at build time is almost dome now, there are still a few modules to adapt. @chennes what was the reason those were left out? I don't remember... |
all in all, I see it as optimizing the process. |
@wwmayer did all of the C++ modules, I think it's the Python Mods that remain, their resource system works a little bit differently. Someone just needs to do it, I think (my cMake skills are pretty weak so I'm not the ideal candidate...). |
I'll have a look at it, but I suffer from the same sickness 😅 |
Such an important topic stuck or abandoned? |
Not at all, we all want it of course |
We have a working solution developed. https://github.com/OPGL/FreeCAD/blob/main/.github/workflows/update_translations.yml I suggest that:
@OPGL I want to thank you for your contribution and commitment. |
Nice work! It still needs an additional step to build the zip file on crowdin before downloading it ( |
You can watch a functional test here: 😉 |
Greetings, Thanks for you answer, i'll fix building zip today. Why length of building that zip is problem? |
Excellent!! |
ref: https://tracker.freecadweb.org/view.php?id=3715 and https://forum.freecadweb.org/viewtopic.php?f=10&t=30340&p=272480#p272480
The text was updated successfully, but these errors were encountered: