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

Take translation out of the build process #443

Merged
merged 7 commits into from
Aug 16, 2024
Merged

Take translation out of the build process #443

merged 7 commits into from
Aug 16, 2024

Conversation

aulemahal
Copy link
Collaborator

@aulemahal aulemahal commented Aug 15, 2024

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • This PR does not seem to break the templates.
  • CHANGELOG.rst has been updated (with summary of main changes).
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.

What kind of change does this PR introduce?

  • Compiled french translations are now kept within the repo and package. No need to make translate on each clone of the source.
  • A new Makefile entry make checkfrench ensures that the french catalog is up-to-date AND that the compiled version is older than the catalog. See notes.
  • The linting CI runs this checkfrench so a PR adding translatable messages cannot be merged if the french translation is not given.

Does this PR introduce a breaking change?

No.

The only change is for developers. make translate needs only to be run if a translatable message was added, after make findfrench was run and the "xscen.po" file updated with the french translation. So, exactly what the contributing guide says to do.

Other information:

The date check on mo files is weak : a catalog file could have a modified time changed even tough no real change was done. And (in theory) a compiled file could have a recent date even though it is not in sync wit the catalog. However, binary comparion of two mo files taken from the same catalog fails. My guess is that the compilation time is included in the mo file, and I didn't want to dig deeper. We don't update the translation catalogs often, so this should be enough.

@Zeitsperre This removes the setup.py stuff. Feel free to change the build system if you feel like doing so!

@aulemahal aulemahal requested a review from Zeitsperre August 15, 2024 18:17
@aulemahal
Copy link
Collaborator Author

As seen on the failure of commit aaee623, the new CI element works as expected.

@aulemahal
Copy link
Collaborator Author

And I checked: installing from this branch with "pip git+https://..." works, while it does not for main.

@aulemahal aulemahal marked this pull request as ready for review August 15, 2024 18:25
Copy link
Contributor

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

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

Well done!

CHANGELOG.rst Outdated Show resolved Hide resolved
Co-authored-by: Trevor James Smith <[email protected]>
@Zeitsperre
Copy link
Contributor

@aulemahal Do we want to enable the French RTD documentation in this PR as well?

@aulemahal
Copy link
Collaborator Author

Je ne pense pas qu'il y ait un besoin et je ne suis personnellement pas à tout à fait à l'aise avec une traduction automatique.

@aulemahal aulemahal merged commit ac19551 into main Aug 16, 2024
17 checks passed
@aulemahal aulemahal deleted the fix-translate branch August 16, 2024 15:33
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

Successfully merging this pull request may close these issues.

Can't compile translation catalog when installing from source
2 participants