Right now, Transifex automatically pulls the latest source/English updates for messages from our repositories on GitHub. However, it does not push translations back to those repositories. I think it should.
There are a few ways (at least) we could approach this:
The “native Transifex” way. Transifex wants there to be a 1:1 correspondence between Git repositories and Transifex projects. In our case, we have one project, “OpenMRS,” which has many “resources,” each of which correspond to a Git repo. If we instead make a Transifex project for each Git repo, then Transifex could be set up to automatically push translations to those repositories. See the Transifex docs.
The GitHub Actions way. I’ve created a GitHub Action in openmrs-owa-orderentry which causes it to download and commit (if available) updated translations from Transifex nightly (also works on demand). We could add this action for any OpenMRS repository.
The Git Hooks way. We could add a Git Hook to repositories so that any time you make a commit (or push, if you prefer), Git downloads new translations.
My preference is for route (2), because
I already have it working
Configuration in code! I’d much rather manage this process via YAML files than via the Transifex UI.
Runs on demand
Git Hooks can be messy, and would take developer time to do the downloading
If we’re in agreement, my only ask is that @burke or @mseaton (the two people who are both GitHub org owners and Transifex org owners) set up a generic OpenMRS bot account in Transifex, get an API token, and add it as a GitHub org secret.
At that point we should be able to create tickets for setting up translation sync for other repositories.
Thanks @bistenes - makes sense to me. Just to echo my reply on Slack - I defer to our infra team and those who have access to organization secrets (@burke or @cintiadr most likely) for the creation of bot accounts and the management of authentication credentials for these that we want to keep track of.
I agree. Route 1 (the “native Transifex” way) could work well if we had a few repos, but isn’t manageable with dozens or hundreds of repos. And I don’t like route 3 (Git Hooks) because it sounds like it would introduce translations randomly into unrelated commits.
You should be able to use TRANSIFEX_TOKEN within your Github Action now.
And I think transifex is automatically configured to get new strings from github
Which I suppose constitutes a “route 4” that I hadn’t considered. So maybe I should just add Bamboo tasks for the OWAs to those jobs? And also for each MFE ESM?
However, I’m very confused by the “auto-reviewing” thing. Why would we want that? As I wrote on Slack,
But why do we “auto-review” translations? Couldn’t we just run tx pull without --mode=reviewed to ignore review status, and then in Transifex we could actually differentiate reviewed from unreviewed translations?
Cool, I’m inclined to do that. Heads up @burke@cintiadr . I would also make tx pull pull non-reviewed translations. As a result, our translation workflow would be exactly the same, except that we would be able to differentiate reviewed from unreviewed translations in the Transifex UI.