Add messages.pot
updates to pre-commit hook (if possible)
#8818
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]
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 themessages.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-existingpre-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
The text was updated successfully, but these errors were encountered: