Uploaded image for project: 'OpenMRS 3.x'
  1. OpenMRS 3.x
  2. O3-1256

Should be possible to override translations using config file

    XMLWordPrintable

Details

    • New Feature
    • Status: Done
    • Must
    • Resolution: Fixed
    • None
    • None
    • Core
    • Medium

    Description

      Suggested Implementation

      • Modify module-config to process a new top-level config key, "Translation overrides." Consult ibacher about the right way to do that. My advice is to follow the example of what he did with "Display conditions": add to the "enhanced schema", handle that piece of the config specially (by adding translation overrides to an overrides store), delete that piece of configuration from the normal `getConfig` tree before returning. The piece of enhanced schema should probably be
      {
        "Translation overrides": {
          _default: {},
          _type: Type.Object,
          _elements: {
            _type: Type.String
          },
          // if you can create a validator that checks that the translation keys provided actually exist in the translations file that would be very cool and helpful
        }
      }
      
      • Modify the i18next loader here to merge the requested file with the overrides store

      There is a possibility that the system will need to be more elaborate, since this means that translations shouldn't resolve until the config is loaded.

      See https://openmrs.slack.com/archives/CHP5QAE5R/p1646332735304489?thread_ts=1646331669.301989&cid=CHP5QAE5R

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                ibacher Ian Bacher
                bistenes Brandon Istenes
                Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: