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
If the id of an element is localized and an anchor is used to link to that element, the id appears in the URL. When switching locales the path is translated correctly, but the id is not translated at all. This means that on loading the new language, the page is trying to scroll to an id that no longer exists on the page, causing it to not scroll at all. In production the green and blue progression bar from Nuxt also appears at the top and never resolves.
Additional context
This problem is much more prevalent when using Nuxt i18n alongside Nuxt Content, since it automatically renders headers as anchors.
Logs
The text was updated successfully, but these errors were encountered:
Maybe this will help somehow: I encountered a similar issue - the keys in $t weren't being translated after changing the language.
So far, I've only understood that the problem is with the langDir parameter, and this started from version 9.1.2 and continues up to the latest version. If you specify the translation keys directly in the messages object within defineI18nConfig, everything works.
But if you place them in separate files, errors start occurring after changing the locale, like index.vue:6 [intlify] Not found 'home.p1' key in 'ja' locale messages.
@valsaven
Your issue sounds different than the one described, could you check if you're still experiencing the same behavior after installing the edge release with npm i -D @nuxtjs/i18n@npm:@nuxtjs/i18n-edge?
I thought it might have something to do with the problem described by the author of this issue. If it doesn't seem related, then to avoid spamming here, if I have time - I'll try to create a reproducible build of this error on https://stackblitz.com/ and open a new issue.
Environment
site, experimental, postcss, modules, icon, shadcn, typescript,
i18n, security
Reproduction
https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-bsxo89jd?file=pages%2Findex.vue
Describe the bug
If the id of an element is localized and an anchor is used to link to that element, the id appears in the URL. When switching locales the path is translated correctly, but the id is not translated at all. This means that on loading the new language, the page is trying to scroll to an id that no longer exists on the page, causing it to not scroll at all. In production the green and blue progression bar from Nuxt also appears at the top and never resolves.
Additional context
This problem is much more prevalent when using Nuxt i18n alongside Nuxt Content, since it automatically renders headers as anchors.
Logs
The text was updated successfully, but these errors were encountered: