How can I change the UI language to Chinese in OpenMRS 3?

,

I followed the documentation and set “ZH” in related setting fields. Now, only the legacy admin interface displays in Chinese. Other interfaces are still in English.

I remember that in version 2.0, it was possible to set and display Chinese correctly.

No one has done the work of translating the O3 UI into Chinese yet, but translation contributions are welcome!

Thanks for your reply. So, how can I create my own local Chinese language file for the O3 version? And how can I contribute it to the community? I did not see the O3 branch on OpenMRS localization | Transifex

O3 is really a combination of frontend modules, so on our Transifex it’s these projects:

1 Like

Thanks for your help!

I have updated the Chinese translations of the above projects on Transifex. How can I update them to my local deployment?

Nice! cc: @mksrom Do you remember the steps to pull things from Transifex.

Well, as I’m trying this, I actually can see that the Transifex version is deprecated (Or so it seems. @ibacher is the CI/CD doing anything with Transifex? Wondering why we have not come across some issues earlier)

We need to migrate the .tx/config files of each repo in order to get this back to working. Running tx migrate will do.

How to pull language files from Transifex:

This should fetch all the resource files in the language specified. Eg output:

 TX_TOKEN=1/53fd_my_token_5fb7f ./tx pull -l zh                                                              18:03:30
# Getting info about resources

openmrs-esm-patient-chart.esm-form-entry-app - Done
openmrs-esm-patient-chart.esm-generic-patient-widgets-app - Done
openmrs-esm-patient-chart.esm-patient-allergies-app - Done
openmrs-esm-patient-chart.esm-patient-appointments-app - Done
openmrs-esm-patient-chart.esm-patient-attachments-app - Done
openmrs-esm-patient-chart.esm-patient-banner-app - Done
openmrs-esm-patient-chart.esm-patient-biometrics-app - Done
openmrs-esm-patient-chart.esm-patient-chart-app - Done
openmrs-esm-patient-chart.esm-patient-conditions-app - Done
openmrs-esm-patient-chart.esm-patient-forms-app - Done
openmrs-esm-patient-chart.esm-patient-immunizations-app - Done
openmrs-esm-patient-chart.esm-patient-labs-app - Resource openmrs-esm-patient-chart.esm-patient-labs-app does not exist
openmrs-esm-patient-chart.esm-patient-medications-app - Done
openmrs-esm-patient-chart.esm-patient-notes-app - Done
openmrs-esm-patient-chart.esm-patient-programs-app - Done
openmrs-esm-patient-chart.esm-patient-vitals-app - Done
[##############################] (16 / 16)

# Pulling files

openmrs-esm-patient-chart.esm-form-entry-app [zh] - Done
openmrs-esm-patient-chart.esm-generic-patient-widgets-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-allergies-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-appointments-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-attachments-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-banner-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-biometrics-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-chart-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-conditions-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-forms-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-immunizations-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-medications-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-notes-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-programs-app [zh] - Done
openmrs-esm-patient-chart.esm-patient-vitals-app [zh] - Done
[##############################] (15 / 15)

Files are now added locally, in the right place.

I’m not sure what’s the next step though @ibacher . I’m assuming this needs to be commited/PRed so we can add the language files to code base.

Configure the allowed locale for your installation

One would probably also need to set the backend locale by setting the locale.allowed.list and default_locale properties. See for example Ozone Distro Cambodia

3 Likes

No, but we need to get that working.

I have basically completed the Chinese translation of the following projects:

  • openmrs-esm-core
  • openmrs-esm-dispensing
  • openmrs-esm-fast-data-entry-app
  • openmrs-esm-home
  • openmrs-esm-patient-management

The following is still in progress:

  • openmrs-esm-patient-chart

I noticed that the above PR seems to only involve openmrs-esm-patient-chart.

Can you also include the other projects related to O3 on Transifex?

2 Likes

Commited upstream thanks @befantasy

https://github.com/openmrs/openmrs-esm-fast-data-entry-app/pulls/jona42-ui

https://github.com/openmrs/openmrs-esm-dispensing-app/pulls/jona42-ui

https://github.com/openmrs/openmrs-esm-core/pulls/jona42-ui

Do we need to add the zh locale to the i18parser config?

@vasharma05 @dennis

Please see also the OpenMRS 3 documentation for Translation config here: Configuring translations – O3 Docs

1 Like

It seems like this is missing: openmrs-esm-patient-management.

Oops! getting it up

Dear all,

Thank you for your help and guidance. I have mostly completed the translation work for the zh_CN language for the several projects on Transifex.

I am lacking in knowledge related to JS and React. I have deployed the O3 with the qa tag images using docker-compose locally and now I would like to ask for your advice on how to display Chinese in my local deployment.

My understanding is that once the GitHub action automatically pulls the zh_CN.json from Transifex to “corresponding project/{module}/translations/”(Ex.: openmrs-esm-patient-chart/packages/esm-form-entry-app/translations), I just need to pull the latest nightly version from Docker Hub locally, is that correct?

So far, I haven’t seen the zh_CN.json file in these paths on GitHub.

So, is there a way for me to directly pull and use the Transifex language files locally? How can I do this? When I used “docker exec” to enter the container of openmrs/openmrs-reference-application-3-frontend locally, I couldn’t find the corresponding module and path.

Thank you.

In the openmrs/openmrs-reference-application-3-frontend container, I found the path for the front-end code: /usr/share/nginx/html, but I didn’t see the locate file.

Apart from the fact that there’s currently no GitHub Action automation, yes.

I believe there are some PRs, but reviewing them lead me to see that the copies of the files on Transifex are quite out of date.

Only if you are comfortable editing the source code yourself. The problem is that the relevant translation files are loaded through Javascript.

I checked openmrs-esm-patient-chart/packages at main · openmrs/openmrs-esm-patient-chart (github.com), and there are several apps that have not been synchronized with transifex. So I can’t translate them on transifex.

Meanwhile, it seems that the .tx/config for several other modules has not been migrated to the new version, and the latest source string have not been synchronized to transifex. (Ex.: openmrs-esm-patient-management/.tx/config at main · openmrs/openmrs-esm-patient-management (github.com)

Could you please help take a look? Thank you.

I have updated the translations for zh and zh_CN and submitted a PR. Please review. Updat the translation for zh and zh_CN by befantasy · Pull Request #1582 · openmrs/openmrs-esm-patient-chart (github.com)

Additionally, I found that some apps in the module are not fully synchronized between GitHub and Transifex; some are only on GitHub( esm-form-engine-app), while others are only on Transifex( openmrs-esm-patient-chart | 资源 (transifex.com).

We’ve retired and moved around some apps, so Transifex is out of date in some places. Other apps have been added after. Thank you for your contributions here and to helping us build out a better connection for translations!