How are you resolving routes while using I18n module?

Previously, I obtained route paths by passing an object with route name and parameters to NuxtLink, which worked perfectly. However, once I introduced the I18n module, all my route names have been prefixed with locale names (loginen, logines, etc.). This now makes it problematic to obtain routes as now I need to pass the current locale alongside with the route name. This makes the code unreadable and adds extra hassle to the development. Do you have any better solution for obtaining route paths?
4 Replies
Philip
Philip2w ago
did you put in the head of the html your default lang? and can you show your nuxt config?
John Baker
John Baker2w ago
Well, I think i18n should be dealing with head automatically. So it sets the lang to the current locale This is the config: i18n: { locales: ["en", "ru"], defaultLocale: "en", vueI18n: "lang/config.js" },
Philip
Philip2w ago
try this?
No description
John Baker
John Baker2w ago
Does it remove locale prefixes from names?
Want results from more Discord servers?
Add your server
More Posts
error connected with nuxtui-pro that text-foreground class doesn' t exist in module[2:17:00 AM] ERROR Pre-transform error: [postcss] /node_modules/.pnpm/@nuxt+ui-pro@1.3.1_nuxt@3.11NuxtI18n - Vue router warnings after language changeHello everyone! Every time I change language with useSwitchLocalePath() of NuxtI18n I get all the rositemap module wont show dynamic routes, routes are emptywe tried to create on root ebene ( /server/api/__sitemap__/urls.ts ) the following ``` import { asSStop fetching favico on every requestHi, How could I prevent fetching every request twice, once with the actual data I'm looking for, aExtend NuxtUI Form ComponentI'm using Nuxt UI and I want to extend the UForm component, to always scrol lthe first error into viNuxt does not render updated content after buildI've integrated WordPress for blogs on our site. At the time of build, the blogs that are already thWARN [nuxt] useAsyncData should return a value that is not null or undefined or the request may beWith the latest update i get this multiple times, but there is no way to see which code is the causeDirective v-debounceHello! I have been trying for a while to create a custom directive debounce.ts in Nuxt without succBest way to cache a pre-rendered SSG project?Hello! Currently I am working in a project that aims to prerender using data from a Database around I get an error connected with nuxtui-pro that text-foreground class doesn' t exist in module[2:17:00 AM] ERROR Pre-transform error: [postcss] /node_modules/.pnpm/@nuxt+ui-pro@1.3.1_nuxt@3.11