Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Commit 6f43fa6

Browse files
committed
feat: ✨ add i18n head
1 parent 3f5d8af commit 6f43fa6

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

app.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,13 @@
33
<NuxtPage/>
44
</NuxtLayout>
55
</template>
6+
7+
<script setup lang="ts">
8+
const i18n = useI18n();
9+
10+
// title
11+
useHead({title: () => i18n.t("global.title")});
12+
13+
// i18n head attributes
14+
useHead(useLocaleHead({addSeoAttributes: true}));
15+
</script>

locales/en-US.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
export default {
2+
global: {
3+
"title": "MCDR Plugin Catalogue",
4+
}
25
};

locales/zh-CN.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
export default {
2+
global: {
3+
"title": "MCDR 插件目录",
4+
}
25
};

nuxt.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const baseURL = "https://mcdr.zhanganzhi.com";
44
export default defineNuxtConfig({
55
app: {
66
head: {
7-
title: "MCDR Plugin Catalogue",
87
meta: [
98
{
109
name: "viewport",

0 commit comments

Comments
 (0)