3

We are using Sitecore 10.2 as headless (JSS) and nextjs for the front end.

When we try to call JSS API it is working with multiple languages.

https://{Sitecore}/sitecore/api/layout/render/jss/?item={ItemID}&sc_apikey={apiKey}&sc_lang={langcode}

But from the front when we try to call, it is working only for EN, not working for other languages. Gives 404 when I try to access for a different language. I guess we are missing something from the front end. Please let me know if we are missing something.

2 Answers 2

4

You would also need to configure the language on the frontend in the next.config.js file:

i18n: {
  locales: ['en', 'da-DK'],
},

Here is the official documentation: https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/internationalization-in-the-jss-sample-app-for-next-js.html

0

If you are trying to export it as static files with next export it won't work. Here is the docs with limitations: https://doc.sitecore.com/xp/en/developers/hd/201/sitecore-headless-development/walkthrough--exporting-a-jss-next-js-app-to-static-html-files-with-next-export.html

1
  • This is a link only answer, please update your answer with additional details Feb 6, 2023 at 21:33

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.