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
did you put in the head of the html your default lang? and can you show your nuxt config?
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"
},
try this?
Does it remove locale prefixes from names?