O3: How to translate O3 apps with Transifex

I’ve recently been asked, “How can our org translate O3 app string content? How do we use Transifex to help with this?”

This is a great question, since any organization needing to translate the O3 EMR will run into this.

Here is my understanding: tl;dr: The translation files will have to be pulled from Transifex and committed into the code directly, for each repo.

  1. Transifex Setup: Ensure the O3 repos you need are included in the OpenMRS Org Transifex project (e.g. you can see esm-patient-management is here, esm-patient-chart is here, etc)
  2. Complete Translation in Transifex UI: Ensure your translation team goes through the UI to translate each repo’s strings (e.g. here at this link we see both the complete & incomplete french translations for the Registration App)
  3. Manual, Simple Workflow:
    • Export JSON from Transifex: In the left navigation, click Resources for the Repo, then click the language you want, and click “Download for use” from the Resources modal that popped up. . This downloads a JSON file for you.
    • Upload JSON into the repo’s esm-NAME-app/translations/ directory: E.g. this example of JSON string translations uploaded for the active visits app
    • Then: The strings should be translated in the UI when the user switches their locale. image

OR 4. Automated Workflow: This can also be done by using the CLI Transifex client and running tx pull -l fr (to get the fr locale for instance) and commit the changes.

Ideally, it should be our CD doing that though. @mksrom recalls that Brandon had set up something a while back with Bamboo, maybe this Build, maybe we can reuse that? @dkayiwa what would we need to do in order to set things up so that translation work done in Transifex is automatically pulled into the O3 RefApp?

@frederic.deniger which approach do you think you’ll want to take? #3 seems surprisingly easy, just manual work to go through the export/import process.

@mksrom or @dkayiwa or @mseaton or @burke anything you’d add or correct here?

2 Likes

Hello @grace thanks for the feedback. IMHO, the manual worklow #3 would be the good approach as we won’t modify these translations every day. Of course, if the Automated workflow can be implemented it will be better but it won’t be a game changer ( and maybe we will spend more time on maintaining this CI than the manual approach).

1 Like

It would require adding the repositories, one by one, to this Bamboo build: TRANSIFEX - Commit Translations to GitHub: Plan summary - OpenMRS Bamboo

1 Like

I thought Transifex had the ability to publish changes to GitHub. If we could leverage that capability, it would allow us to manage translations in one place (i.e., any repo set up in Transifex would get updates without needing to maintain a separate list in Bamboo).

1 Like

can his be helpful?

This sounds simple… am I missing something? @dkayiwa what would be the approx amount of time this would take you to set up? (I tried doing it myself following this documentation but I don’t know if I have all the right admin permissions.)

And is there any reason not to automatically grab translations out of Transifex and add them to our O3 repos?

Are you referring to what @burke said above of Transifex’s ability to publish changes to GitHub?