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

[instruments] Multilingual instrument support #9522

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

CamilleBeau
Copy link
Contributor

@CamilleBeau CamilleBeau commented Jan 7, 2025

Brief summary of changes

This is the CCNA implementation of multilingual support for instruments, but with some changes to support different languages.

Instrument labels are added in JSON files with the language code as a key. One default JSON labels file is included in modules/instruments/language_labels/instrument_library_labels.json which includes English and French for labels used in NDB_BVL_Instruments.class.inc. If projects want to add more languages, they must put another version of this file in project/instruments/language_labels/instrument_library_labels.json with a new key for the additional language, and all of the same labels translated into the additional language. This new file can be tracked on the project's repository.

The language support is only for php instruments at the moment. To have a multilingual instrument, the translated test name should be inserted into test_names_multilingual linked to the appropriate language ID. The function $this->getLangLabel('key') can be used anywhere in the instrument to use translated labels. A JSON file must be created in the same format as modules/instruments/language_labels/instrument_library_labels.json and put into the project/instruments/language_labels/ directory with the following naming convention: <test_name>.json

Screen Shot 2025-01-06 at 2 38 21 PM
  • Have you updated related documentation?

Testing instructions (if applicable)

  1. Run patches / re-import raisinbread from this branch (this will make the instrument Radiology Review multi-lingual)
  2. Create a french session that includes the Radiology Review instrument (or go to OTT285 V1 which is already set to french in raisinbread data from this PR)
  3. Make sure that the Radiology Review instrument test name shows up in french from the instrument list for the french session
  4. Go to Radiology review and make sure the labels on the instrument are shown in french
  5. Validation errors should show in french as well
  6. Check that the survey module displays the survey in french

Link(s) to related issue(s)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Overrides] Instrument support for multiple languages (translation)
2 participants