sveltekit-i18n Internationalization for SvelteKit

Examples

Eight standalone applications, each covering one decision you make once and live with. Every one of them runs in the browser — Node and the dev server boot inside the tab, with nothing installed locally.

Routing

  • Multi-page Several routes, no locale in the URL. The locale is negotiated per request from a cookie, then Accept-Language.
  • Locale in the query /about?lang=cs, resolved on the server before rendering. Not the SEO option, and it says so.
  • Locale router /en/about, /cs/about, /de/about, everything prerendered, with entries() for what the crawler cannot reach.
  • Static locale router The same routing with no server at all: one HTML file per page per locale.
  • Advanced locale router The default locale keeps the bare URL and the error page is yours, translated on the first hit. What this site runs on.

Component-scoped translations

  • Component-scoped (CSR) A component carrying its own instance and its own lexicon, loaded in the browser.
  • Component-scoped (SSR) The same component, loaded by the page and handed down through snapshot(): complete on the first render.

Content

  • mdsvex A route written in Markdown: t() inside .svx, route-scoped loading, prerendered per locale.