You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to automatically put it in all a tags of the project when accessing the URL only when the following lang is included.
/about
/en/about
/ko/about
/ja/about
Since SvelteKit requires using anchor tags for links, do I have to insert the {lang} value into every anchor tag?
In non-Svelte libraries, I've seen examples where it's automatically created like:
previous /home => <router-link :to="{ name: 'about'}">about</router-link> => /about
previous /en/home => <router-link :to="{ name: 'about'}">about</router-link> => /en/about
previous /ko/home => <router-link :to="{ name: 'about'}">about</router-link> => /ko/about
But I'm not sure how to achieve this in SvelteKit right now. Can you help?
It seems like there are no hooks or anything.
For example, if I want to use a NavBar library, I have to do something like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I want to automatically put it in all a tags of the project when accessing the URL only when the following lang is included.
/about
/en/about
/ko/about
/ja/about
Since SvelteKit requires using anchor tags for links, do I have to insert the {lang} value into every anchor tag?
In non-Svelte libraries, I've seen examples where it's automatically created like:
previous
/home
=><router-link :to="{ name: 'about'}">about</router-link>
=>/about
previous
/en/home
=><router-link :to="{ name: 'about'}">about</router-link>
=>/en/about
previous
/ko/home
=><router-link :to="{ name: 'about'}">about</router-link>
=>/ko/about
But I'm not sure how to achieve this in SvelteKit right now. Can you help?
It seems like there are no hooks or anything.
For example, if I want to use a NavBar library, I have to do something like this:
Do I have no choice but to create a separate function to calculate the url value to put into the href?
Beta Was this translation helpful? Give feedback.
All reactions