Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3920

Module message properties should not be forced to have their keys start with moduleId

    XMLWordPrintable

    Details

    • Complexity:
      Low
    • Sprint:
      Platform 2.0 Beta Sprint 1

      Description

      Background

      In the early days of the OpenMRS module architecture, we required all module message property keys to start with the module id, and if they did not, we automatically prepended the module id. This wasn't always desirable, so in TRUNK-3851 we introduced the ability to add this directive to a messages.properties file to change OpenMRS's behavior:

      openmrs.property.MESSAGE_PROPERTY_ALLOW_KEYS_OUTSIDE_OF_MODULE_NAMESPACE = true
      

      Unfortunately, some translation tools (including transifex) don't show the message code in their default translation views, and it's easy for someone to inadvertently translate the "true" to another language.

      The original behavior (automatically ensuring that message keys start with the module id) was actually misguided, because it is not always desirable, and introduces magical behavior that is not standard in other systems. We must maintain this "feature" for backwards-compatibility, but we should remove it in openmrs-core 2.0 when we're allowed to introduce backwards-incompatible changes to the API.

      To Do

      1. Remove the behavior where module message keys have the module id prepended if they don't already start with it
        • ensure that wiki documentation about module message property files says that keys are typically recommended to be namespaced with the module id, but you're allowed to deviate from this in some cases (but that behavior was different before openmrs-core 2.0)
      2. Remove any code that has to do with openmrs.property.MESSAGE_PROPERTY_ALLOW_KEYS_OUTSIDE_OF_MODULE_NAMESPACE (since this purely served to override the behavior we're removing)
        • also update any wiki references to this behavior to state

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              ttcphilips Thisura Thejith
              Reporter:
              darius Darius Jazayeri
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days
                  2d
                  Remaining:
                  Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified