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

Add messages.pot updates to pre-commit hook (if possible) #8818

Closed
rebecca-shoptaw opened this issue Feb 13, 2024 · 1 comment · Fixed by #8900
Closed

Add messages.pot updates to pre-commit hook (if possible) #8818

rebecca-shoptaw opened this issue Feb 13, 2024 · 1 comment · Fixed by #8900
Assignees
Labels
Lead: @cdrini Issues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] registration Theme: Internationalization Making OpenLibrary work for both foreign-language users and books. [managed] Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed]

Comments

@rebecca-shoptaw
Copy link
Collaborator

Describe the problem that you'd like solved

It would be nice if the messages.pot file, which stores all the to-be-translated strings and their locations in the current version of the code, could be updated automatically with new PRs to keep everything more up to date for translators. After finishing up a bulk update to the messages.pot file for translations (#8817), I was talking with @cdrini about options for automating the process:

Proposal & Constraints

I'm not sure how the implementation for this would work, or whether it would be possible, but ideally one would bundle in the command that generates a new messages.pot file -- docker compose run --rm -uroot home ./scripts/i18n-messages extract -- into the already-existing pre-commit hook. More info re: updating in the documentation.

This would be great, as it would mean that any time someone adds a new untranslated string, or modifies a file so the string line numbers are different, the update to the translation file would be included in the PR. Optionally/if possible, it would be great if the translation update could only run if the Python and/or HTML files had been modified, as those are the only changes that would affect it.

Alternatively, either if this isn't possible or just as a stop-gap measure, one could add a note to the Git Cheat Sheet that requests that people run the command themselves as part of the PR if their update has involved adding/changing any on-screen text. If this is the preferred solution or just something that would be good in the meantime, I'd be happy to do that update myself!

Additional context

Stakeholders

@cdrini

@rebecca-shoptaw rebecca-shoptaw added Needs: Lead Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed] labels Feb 13, 2024
@mekarpeles mekarpeles added Theme: Internationalization Making OpenLibrary work for both foreign-language users and books. [managed] Lead: @cdrini Issues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed] and removed Needs: Lead labels Feb 20, 2024
@rebecca-shoptaw
Copy link
Collaborator Author

I'm (provisionally) on it!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @cdrini Issues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] registration Theme: Internationalization Making OpenLibrary work for both foreign-language users and books. [managed] Type: Feature Request Issue describes a feature or enhancement we'd like to implement. [managed]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants