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

Python3 l10n #2525

Merged
merged 37 commits into from
Apr 19, 2022
Merged

Python3 l10n #2525

merged 37 commits into from
Apr 19, 2022

Conversation

darkdreamingdan
Copy link
Member

@darkdreamingdan darkdreamingdan commented Jan 23, 2022

This PR refactors the Python l10n scripts. I've generally modernized them to be Python3 ready and written unit tests around them. Opening this for feedback.

@patrikjuvonen patrikjuvonen added enhancement New feature or request i18n/l10n labels Jan 23, 2022
@patrikjuvonen patrikjuvonen added this to the Next Release (1.6.0) milestone Jan 23, 2022
@patrikjuvonen patrikjuvonen added refactor and removed enhancement New feature or request labels Jan 23, 2022
Copy link
Contributor

@patrikjuvonen patrikjuvonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @darkdreamingdan for going out your way to upgrade these scripts! This is much appreciated.

I am not fluent in Python so I can't really review the code so much, but it looks clear enough when I eyed it through, so I think it's fine. If there is anyone here fluent in Python, a code review would be appreciated.

I found some nitpick issues regarding some non-code related typos and such, but that's about it.

Code runs well on my Windows machine and it looks to be outputting correct stuff. I haven't extensively tested this (yet).

I wonder if this will run with our current GitHub Action out of the box. The goal would be to run these scripts either periodically, or on pull request and push, and create a new pull request for any source changes. This way the source pot remains up-to-date and our Crowdin project will automatically pull the latest source from Git. This is what our current GitHub Action does at the moment. I believe it is just a matter of upgrading the action's Python version to 3 and updating filepaths if needed. We could also move to Linux instead of Windows on the action for some added efficiency. This is all something I can have a look later in this pull request if that's fine with you, unless you would like to debug and upgrade the action yourself. Either is fine to me.

I think the only question from me now is that could we update the xgettext executable to the latest static version? I doubt we need the shared version (the one with the DLLs), those could be removed from our repo.

All in all great work! 👍

Update: I fixed the nit issues, updated the xgettext executable and rewrote the GitHub actions workflow to take pull requests into account.

utils/localization/README.md Outdated Show resolved Hide resolved
utils/localization/environment.yml Outdated Show resolved Hide resolved
utils/localization/tests/test_build_gettext_catalog_nsi.py Outdated Show resolved Hide resolved
utils/localization/tests/test_build_locale_nsi.py Outdated Show resolved Hide resolved
utils/localization/build_locale_nsi.py Outdated Show resolved Hide resolved
utils/localization/build_locale_nsi.py Outdated Show resolved Hide resolved
utils/localization/build_locale_nsi.py Outdated Show resolved Hide resolved
@patrikjuvonen patrikjuvonen added the keep This pull request is exempt from stale checks label Feb 7, 2022
We've already got commits at this point, not staged changes. BRAINFAAART.

[ci skip]
@patrikjuvonen patrikjuvonen mentioned this pull request Apr 19, 2022
5 tasks
@patrikjuvonen patrikjuvonen self-assigned this Apr 19, 2022
@patrikjuvonen patrikjuvonen self-requested a review April 19, 2022 18:24
patrikjuvonen and others added 4 commits April 19, 2022 22:38
Pull requests won't work too well as it requires someone to actively do something about them, causing pull requests and branches to go out of sync.
[ci skip]
Running on pull_request causes conflicts
@patrikjuvonen patrikjuvonen marked this pull request as ready for review April 19, 2022 19:51
@patrikjuvonen patrikjuvonen merged commit 583f2b9 into master Apr 19, 2022
@patrikjuvonen patrikjuvonen deleted the python3_l10n branch April 19, 2022 20:43
@patrikjuvonen patrikjuvonen removed the keep This pull request is exempt from stale checks label Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants