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

Cannot translate {type} placeholder in ControlledVocab

    XMLWordPrintable

Details

    • Volaris Sprint 147, Volaris Sprint 146
    • 3
    • Volaris
    • 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> wird <b>gelöscht.</b>"
      "Die {type} <b>{term}</b> wird <b>gelöscht.</b>"
      "Das {type} <b>{term}</b> wird <b>gelöscht.</b>" 

      depending on genus of {type}.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                priyanka_terala Priyanka Terala
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases