opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
42 stars 0 forks source link

SvelteKit url matchers with Translated paths #52

Closed runar-rkmedia closed 5 months ago

runar-rkmedia commented 6 months ago

If setting up translated paths as in desribed in https://inlang.com/m/dxnzrydw/library-inlang-paraglidejsadaptersveltekit#translated-paths it does not work with matchers https://kit.svelte.dev/docs/advanced-routing#matching

export const i18n = createI18n(runtime, {
  defaultLanguageTag: 'nb',
  pathnames: {
    '/Case': {
      en: '/case',
      nb: '/sak',
    },
    '/Case/[ID=integer]': {
      en: '/case/[ID=integer]',
      nb: '/sak/[ID=integer]',
    },
    '/Case/New': {
      en: '/case/new',
      nb: '/sak/ny',
    },
  },
})

Here, the /en/case/new and /sak/ny links are rewritten in a href's, but they result in 404s

If I change the url in the code to for instance /en/newcase and /newsak respectively, it works.

/Case/New works in all conditions.

awbx commented 6 months ago

I am encountering the identical issue.

LorisSigrist commented 6 months ago

Hi! As stated in the docs, currently only simple params are supported. This means: no matchers, no wildcard segments and no optional segments.

This limitation is something we will be fixing soon