Currently there is no client side API implementation done of the Sitecore dictionary translation API in the official Sitecore ASP .NET Core SDK, therefore I decided to implement a PoC. After googling a bit I found, Sitecore already provides an API endpoint to resolve dictionary items and it’s already implemented in the JSS clients. So based on this documentation I found the API endpoint on my local Sitecore CM instance, which is
/sitecore/api/jss/dictionary/<site>/<language>/?sc_apikey=<apikey>
The response of this endpoint is the following:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"lang": "en", | |
"app": "Discovering.Sitecore101", | |
"phrases": { | |
"label1": "label 1", | |
"label2": "label 2" | |
} | |
} |