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

Add a localization REST resource to expose translation messages

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Major
    • 13.3-rc-1
    • 12.10.5, 13.2-rc-1
    • REST
    • None
    • Unit, Integration
    • Medium
    • Pull Request accepted

    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

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

              Dates

                Created:
                Updated:
                Resolved: