frontline-hq / sveltekit-i18n

A repository to easily handle content and localization in SvelteKit
MIT License
0 stars 0 forks source link

Centrally initialize contents for every page #1

Open frontline-codes opened 1 year ago

frontline-codes commented 1 year ago

Currently, we have to call the init() function in each pages corresponding load() function within the +page.ts file.

That means, we have to add the same code in multiple files to pass contents to the page.

We need a different approach. Where can we generate some data (at build time) based on the page routes lang parameter and pass it to the page so that it is accessible there?

Opened a sveltekit discussion: https://github.com/sveltejs/kit/discussions/9272