amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.62k stars 236 forks source link

[Docs]: Example Integration of next-intl with Common CMS (e.g., Strapi) #1216

Open robsannaa opened 4 months ago

robsannaa commented 4 months ago

Link to page

No response

Describe the problem

Hello,

It would be fantastic to have an example showing how to use next-intl with popular CMS platforms like Strapi. Specifically, an example that demonstrates how to set up dynamic routes like /[lng]/[product-name], and fetch both server-side and client-side static content, such as header and footer links, would be incredibly helpful.

What I would suggest to cover:

Including:

amannn commented 3 months ago

I absolutely agree, would be great to add some docs for this! We can use this issue for the time being to collect content ideas.

I think one of the major pieces relevant to this is retrieving a locale from next-intl and passing it to calls to your CMS. I briefly touch on this topic in an article I wrote in this section: Internationalizing backend data.

Apart from that, if you're using a CMS to manage localized slugs of pages, you might want to consider using a catch-all-based routing system like app/[locale]/[[...slug]] (see the note in the localized pathnames docs).

leon2811-be commented 3 months ago

Also trying to get SSR to work with localized slugs from Strapi... can't get it to work withoud sketchy workarounds and a delay during language switch.

paulmwatson commented 1 month ago

Any progress on this? Looked at Decap CMS and next-inl but phew, complex. First hurdle is going from YML to JSON. Now looking at Hygraph CMS and next-intl.