sveltekit-i18n / lib

Internationalization library built for SvelteKit.
MIT License
491 stars 32 forks source link

t is not loaded with dynamic url #136

Closed yazer79 closed 1 year ago

yazer79 commented 1 year ago

When I try to use a route like "...en/blog" with translation, it works fine

      key: 'about',
      routes: ['/about'],
      loader: async () => (await import('./en/about.json')).default

But if it was a dynamic url with slug like " ...en/blog/amazing-post", the translation is not loaded if you remove the slug, request the url to get a 404, then put the slug back again, the translation works with the dynamic route Using: sveltekti18n 2.v.2 and locale-router example

jarda-svoboda commented 1 year ago

You could use RegExp instead of a string in routes array to match your dynamic route.