dido_dev
dido_dev
NNuxt
Created by dido_dev on 3/12/2025 in #❓・help
$t doesn't work in Nuxt ^3.16.0 i18n ^9.3.1
Hi, after upgrading to Nuxt ^3.16.0 and @nuxtjs/i18n ^9.3.1, the $t function stopped working. I kept the same configuration as before, following the documentation, but translations are not being returned. If I downgrade to Nuxt ^3.15.4 and @nuxtjs/i18n ^8.5.6, everything works fine. Here is a reproduction: https://stackblitz.com/edit/nuxt-starter-rrujrcfn?file=package.json What has changed in the new version? We have many projects, so we need to know if we should stay on the old version. Thanks and kind regards, Davide
6 replies
NNuxt
Created by dido_dev on 4/12/2024 in #❓・help
SEO Configuration Issue with Ignoring Localized
Hi, I need to exclude a few pages from some locales and prevent hreflang tags from being created for them. I'm struggling to figure out how to do this, but I found this guide on Ignoring Localized Routes: https://i18n.nuxtjs.org/docs/guide/ignoring-localized-routes. I have three locales ['it', 'en', 'en-us'] and I'm trying to enable only 'it' and 'en' for the page with the following setup:
<script setup>
defineI18nRoute({
locales: ['it', 'en']
})
</script>
<script setup>
defineI18nRoute({
locales: ['it', 'en']
})
</script>
This should remove ['en-us']. Here is my head configuration:
const head = useLocaleHead({
addDirAttribute: true,
identifierAttribute: 'id',
addSeoAttributes: true,
})
const head = useLocaleHead({
addDirAttribute: true,
identifierAttribute: 'id',
addSeoAttributes: true,
})
I expected that this would remove the en-us hreflang and SEO references, but it hasn’t. So, how can I prevent rendering i18n SEO attributes for certain locales to avoid SEO issues from crawlers? Any suggestions would be appreciated! Thanks and kind regards, Davide
1 replies