-
|
It might be more of generic Nuxt question, but seems there are quite some references to I'm devleoping multi-language website with nuxt+nuxt-i18n and somehow confused about all those composables: First my googling led me to reddit and few other threads where it sounds like there is a general consensus from the folks -
Copilot gave me similar answer:
However what really-really confuses me is that official nuxt-i18n SEO guide uses And that's not over! The very same seo guide has example of layout code: <script setup>
const route = useRoute()
const { t } = useI18n()
const head = useLocaleHead()
const title = computed(() => t(route.meta.title ?? 'TBD', t('layouts.title'))
);
</script>
<template>
<div>
<Html :lang="head.htmlAttrs.lang" :dir="head.htmlAttrs.dir">
<Head>
<Title>{{ title }}</Title>
<template v-for="link in head.link" :key="link.key">
<Link :id="link.key" :rel="link.rel" :href="link.href" :hreflang="link.hreflang" />
</template>
<template v-for="meta in head.meta" :key="meta.key">
<Meta :id="meta.key" :property="meta.property" :content="meta.content" />
</template>
</Head>
<Body>Could someone please clarify, why is that here? I mean, why would one need to start layout with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Seems like the core of my confusion was outdated docs of i18n. I tried to compile what I understood trying it out and working with Copilot into updating PR #3804 |
Beta Was this translation helpful? Give feedback.
Seems like the core of my confusion was outdated docs of i18n. I tried to compile what I understood trying it out and working with Copilot into updating PR #3804