0

Sitecore JSS does not deliver dictionary entries from pathes specified in config files. https://xxx.local/sitecore/api/jss/dictionary/xxx/en?sc_apikey={6B8DB342-F35D-481F-8C16-87B7319B6F6E} returns dictionary entries from system/dictionary, but in config files pointed

<app name="xxx"
                     sitecorePath="/sitecore/content/xxx local/xxx"
                     useLanguageSpecificLayout="true"
                     graphQLEndpoint="/api/WineShop"
                     importDatabase="web"
                     inherits="defaults"

        /> 

and there is folder xxx Dictionary which has dictionary entries which are not delivered.

3 Answers 3

2

If you haven't updated the sample project given by JSS then the dictionary service URL will be generated something like below from the jss app.

const dictionaryServicePath = `${config.sitecoreApiHost}/sitecore/api/jss/dictionary/${config.jssAppName}/{{lng}}?sc_apikey=${config.sitecoreApiKey}`;

But in your case looks like you tried with the direct URL and that returns entries from system/dictionary. So check your include folder and verify whether you have the updated/proper jss app config .\Website\App_Config\Include\JSS-APP-Name.config.

Because you get error/improper results when you access the direct URLs like https://xxx.local/sitecore/api/jss/dictionary/xxx/en?sc_apikey={6B8DB342-F35D-481F-8C16-87B7319B6F6E} so the issue will be with the jss-app config files which you deployed in your Sitecore instance or the Sitecore content tree [which may not have the proper content tree/structure]

Actually the jss document is really helpful https://jss.sitecore.com/docs/fundamentals/services/dictionary-service

1

The Sitecore JSS comes with a set of default configurations located in

App_Config\Sitecore\JavaScriptServices\Sitecore.JavaScriptServices.Apps.config

Since your configuration setting does not include the dictionary path, it will use the following default settings found in Sitecore.JavaScriptServices.Apps.config.

dictionaryPath="$sitecorePath/$name Dictionary"
dictionaryDomain="$name Dictionary"

Now, if Sitecore is unable to find your dictionary files based on the "dictionaryPath" in the configuration, it will fallback to use "/sitecore/system/dictionary", which is the behavior that you are observing.

To solve your problem, I am guessing it could not find your dictionary path. Do check if it is in the correct path, or patch it in your config to desired path.

<App name="xxx" 
    dictionaryPath="Enter your sitecore dictionary path ..."
    dictionaryDomain="Enter your sitecore dictionary domain ..."
/>
0

A shot in the dark here, but have you tried deleting dictionary.dat file from your Sitecore installation /temp folder? That should regenerate the dictionary file with the latest dictionary items (as long those are published).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.