Uploaded image for project: 'stripes-smart-components'
  1. stripes-smart-components
  2. STSMACOM-453

Cannot translate {type} placeholder in ControlledVocab

    XMLWordPrintable

    Details

    • Template:
      Standard Bug Write-Up Format
    • Development Team:
      Stripes Force
    • Affected Institution:
      GBV, University of Leipzig

      Description

      Overview: refactor ControlledVocab to accept translation keys as props and issue a console deprecation warning when such props are not provided.

      Details: ControlledVocab strings with a placeholder for {type} cannot be correctly translated in some languages. Instead of CV having translation keys with values like

      "The {type} <b>{term}</b> will be <b>deleted.</b>"
      

      it needs to accept as props translation keys with values like

      "The patron group <b>{term}</b> will be <b>deleted.</b>"
      

      To avoid a breaking change, the existing CV translation keys should stay in place and be used only if new props are not provided. Using the existing CV translation keys should cause a deprecation warning in the console. Maybe add a new prop, translations, an object shaped like this:

        "cannotDeleteHeader": "ui-users.cv.foo.cannotDeleteHeader",
        "cannotDeleteMessage": "ui-users.cv.foo.cannotDeleteMessage",
        "noneExist": "ui-users.cv.foo.noneExist",
        "willDelete": "ui-users.cv.foo.willDelete",
        "wasDeleted": "ui-users.cv.foo.wasDeleted",
      

      Why do we have to do this? Doesn't everybody speak American?
      A German translation of

      "The {type} <b>{term}</b> will be <b>deleted.</b>"
      

      is

      "Der {type} <b>{term}</b> will be <b>deleted.</b>"
      "Die {type} <b>{term}</b> will be <b>deleted.</b>"
      "Das {type} <b>{term}</b> will be <b>deleted.</b>"
      

      depending on genus of {type}.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    TestRail: Runs

                      TestRail: Cases