The interface is translated through @nuxtjs/i18n: strings live in i18n/locales/*.json, routes are prefixed except for the default English, and useLocaleHead emits the lang attribute, the hreflang alternates and og:locale. The switcher is a native select rather than a custom dropdown: keyboard support, the platform picker on mobile and correct labelling come for free. Article content stays single-language — this translates the site chrome only.
14 lines
263 B
Vue
14 lines
263 B
Vue
<script setup lang="ts">
|
|
// Emits <html lang>, the alternate-language links and og:locale for every page.
|
|
useHead(useLocaleHead())
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<NuxtRouteAnnouncer />
|
|
<NuxtLayout>
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
</div>
|
|
</template>
|