Next.js Discord

Discord Forum

How to translate long page

Unanswered
B33fb0n3 posted this in #help-forum
Open in Discord
How would you make a translation of a complete and long page?

I currently translate according to the NextJs principle described here: https://nextjs.org/docs/app/building-your-application/routing/internationalization#localization

But now I would also like to translate my legal notice or my privacy policy, for example, which is incredibly long. Creating a separate path for each individual part is possible, but not only time-consuming, but also annoying.

Do you have any ideas?

8 Replies

Basing on my current projects, dynamic routes with SSG for translations in App Router works best, as user doesn't feel the "lag" after changing routes, languages etc. when on client-side translations there is a small "lag" as frontend is fetching chunks with new language. Also that's a better solution for indexing bots like google and minimizes risk of delayed language change or low performance due to low Core Web Metrics.

Hope this will clarify this topic a bit. Ofc builds are going to take longer as it will pre-render for sites * languages, but still worth it IMHO 😄
Ok, can you share more informations about structure of that content, data source etc? Typically if there is long content, it's better to use CMS like prepr/contentful or anything other, which have support for multi-lang content and just preprender each version
@Z4NR34L Ok, can you share more informations about structure of that content, data source etc? Typically if there is long content, it's better to use CMS like prepr/contentful or anything other, which have support for multi-lang content and just preprender each version
in the first screenshot you can see my html structure and in the second pictures the translation json to it. I am feeling so dump to give these kind of variable names...

And that's just one part of the page. I think I currently have like 10-20 page parts...
You are serving this content from json file yeah?
I am using the json file for the translation. You can see more about it here:

I currently translate according to the NextJs principle described here: https://nextjs.org/docs/app/building-your-application/routing/internationalization#localization

@Z4NR34L
As I was thinking about that, the best solution here is to use CMS, there is no golden solution if you don't want to make translation files