Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
robsannaa opened this issue Jul 24, 2024 · 3 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@robsannaa
Copy link

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:

  • Dynamic Routes: setting up and handling dynamic routes, such as /[lng]/[product-name].

    Including:
    - Configuring next-intl for dynamic locales.
    - Setting up Next.js dynamic routes to handle language parameters.
    - Fetching and rendering content based on the locale and dynamic route parameters.

  • Fetching static content:
    Fetching content for static elements such as header, footer, buttons, tooltips and so on

Including:
- Server-Side Fetching: How to fetch localized static content like header and footer links from a CMS like Strapi during server-side rendering (SSR).
- Client-Side Fetching: How to dynamically fetch and update localized content on the client-side for a smooth user experience when switching languages or navigating.

@robsannaa robsannaa added documentation Improvements or additions to documentation unconfirmed Needs triage. labels Jul 24, 2024
@amannn
Copy link
Owner

amannn commented Aug 14, 2024

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).

@amannn amannn removed the unconfirmed Needs triage. label Aug 14, 2024
@leon2811-be
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants