Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18491

Add a localization REST resource to expose translation messages

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 12.10.5, 13.2-rc-1
    • Fix Version/s: 13.3-rc-1
    • Component/s: REST
    • Labels:
      None
    • Tests:
      Unit, Integration
    • Difficulty:
      Medium
    • Pull Request Status:
      Pull Request accepted
    • Similar issues:

      Description

      The main goal is to allow JavaScript code use localized messages without having to rely on Velocity code. The JavaScript module that needs to use some translation keys would fetch them using an URL like this:

      /xwiki/rest/wikis/{wikiName}/localization/translations?locale=en&prefix=livedata.&key=one&key=two&...
      

      The locale and prefix parameters should be optional. The client side should provide the list of translations keys it needs to use. The output will be a "list" of (key, value) associations, where the value is the raw translation source. This means the client side will be responsible for applying (interpolating) translation parameters.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mleduc Manuel Leduc
                Reporter:
                mflorea Marius Dumitru Florea
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: