feat(i18n): add internationalization support
This commit introduces internationalization (i18n) support by integrating the `@nuxtjs/i18n` module. It configures English (en) and Simplified Chinese (zh-CN) locales, adds a language selector to the header, and internationalizes the index page content using translation files.
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
<template>
|
||||
<UPage>
|
||||
<UPageSection title="Trusted by">
|
||||
<UHeader>
|
||||
<template #title> Tootaio Studio </template>
|
||||
<template #right>
|
||||
<ULocaleSelect
|
||||
:model-value="locale"
|
||||
:locales="[en, zh_cn]"
|
||||
@update:model-value="(v) => setLocale(v as 'en' | 'zh-CN')"
|
||||
/>
|
||||
</template>
|
||||
</UHeader>
|
||||
<UPageSection
|
||||
title="Trusted by"
|
||||
:description="$t('index.trustedBy', { count: 10000 })"
|
||||
>
|
||||
<UMarquee>
|
||||
<img
|
||||
v-for="logo in trustedBy"
|
||||
@@ -15,6 +28,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { en, zh_cn } from "@nuxt/ui/locale";
|
||||
const { locale, setLocale } = useI18n();
|
||||
|
||||
const trustedBy = ref([
|
||||
{ src: "/index/trusted-by/logoipsum-284.svg", alt: "Logo Ipsum" },
|
||||
{ src: "/index/trusted-by/logoipsum-338.svg", alt: "Logo Ipsum" },
|
||||
|
||||
Reference in New Issue
Block a user