From 16ece63ae24664b744805126c40eb469e6f96829 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 30 Nov 2025 15:24:31 +0800 Subject: [PATCH] :sparkles: Globalization --- app/components.d.ts | 4 - app/layouts/default.vue | 85 +- app/pages/index.vue | 37 +- app/pages/products/solar-network.vue | 104 +- i18n/en.json | 71 + i18n/zh-cn.json | 71 + nuxt.config.ts | 41 +- package-lock.json | 1853 +++++++++++++++++++++++++- package.json | 4 +- 9 files changed, 2162 insertions(+), 108 deletions(-) create mode 100644 i18n/en.json create mode 100644 i18n/zh-cn.json diff --git a/app/components.d.ts b/app/components.d.ts index 3bf81c3..e49b0fe 100644 --- a/app/components.d.ts +++ b/app/components.d.ts @@ -15,9 +15,7 @@ declare module 'vue' { NAvatar: typeof import('naive-ui')['NAvatar'] NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] - NDropdown: typeof import('naive-ui')['NDropdown'] NIcon: typeof import('naive-ui')['NIcon'] - NMenu: typeof import('naive-ui')['NMenu'] NPopover: typeof import('naive-ui')['NPopover'] NTag: typeof import('naive-ui')['NTag'] RouterLink: typeof import('vue-router')['RouterLink'] @@ -30,9 +28,7 @@ declare global { const NAvatar: typeof import('naive-ui')['NAvatar'] const NButton: typeof import('naive-ui')['NButton'] const NCard: typeof import('naive-ui')['NCard'] - const NDropdown: typeof import('naive-ui')['NDropdown'] const NIcon: typeof import('naive-ui')['NIcon'] - const NMenu: typeof import('naive-ui')['NMenu'] const NPopover: typeof import('naive-ui')['NPopover'] const NTag: typeof import('naive-ui')['NTag'] const RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 1acb1ea..58584b1 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -32,7 +32,16 @@ /> - +
+ + + {{ locale.toUpperCase().split("-")[0] }} + +
@@ -46,39 +55,45 @@ @@ -86,9 +101,10 @@