From d0d50ac9d3215f247f749585a7831a1d6027c280 Mon Sep 17 00:00:00 2001 From: qwqcode Date: Thu, 29 Aug 2024 11:57:32 +0800 Subject: [PATCH] perf(ui/sidebar): optimize setup process and i18n lazy load --- docs/docs/guide/frontend/i18n.md | 1 + ui/artalk-sidebar/src/App.vue | 86 +----- ui/artalk-sidebar/src/artalk.ts | 84 ++++++ ui/artalk-sidebar/src/global.ts | 32 +-- ui/artalk-sidebar/src/i18n-en.ts | 99 +++++++ ui/artalk-sidebar/src/i18n.ts | 37 +++ ui/artalk-sidebar/src/i18n/messages.ts | 257 ------------------ ui/artalk-sidebar/src/i18n/zh-CN.ts | 97 +++++++ ui/artalk-sidebar/src/lib/promise-polyfill.ts | 9 + ui/artalk-sidebar/src/main.ts | 79 +++--- ui/artalk-sidebar/src/vue-i18n.d.ts | 7 + ui/artalk-sidebar/tsconfig.json | 2 +- 12 files changed, 390 insertions(+), 400 deletions(-) create mode 100644 ui/artalk-sidebar/src/artalk.ts create mode 100644 ui/artalk-sidebar/src/i18n-en.ts create mode 100644 ui/artalk-sidebar/src/i18n.ts delete mode 100644 ui/artalk-sidebar/src/i18n/messages.ts create mode 100644 ui/artalk-sidebar/src/i18n/zh-CN.ts create mode 100644 ui/artalk-sidebar/src/lib/promise-polyfill.ts create mode 100644 ui/artalk-sidebar/src/vue-i18n.d.ts diff --git a/docs/docs/guide/frontend/i18n.md b/docs/docs/guide/frontend/i18n.md index 85a60aad..f9ae9f8b 100644 --- a/docs/docs/guide/frontend/i18n.md +++ b/docs/docs/guide/frontend/i18n.md @@ -28,6 +28,7 @@ locale: zh-CN | -------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | 后端程序 | [/i18n/[LANG].yml](https://github.com/ArtalkJS/Artalk/tree/master/i18n) | [zh-CN.yml](https://github.com/ArtalkJS/Artalk/blob/master/i18n/zh-CN.yml) | | 前端界面 | [/ui/artalk/src/i18n/[LANG].ts](https://github.com/ArtalkJS/Artalk/tree/master/ui/artalk/src/i18n) | [zh-CN.ts](https://github.com/ArtalkJS/Artalk/blob/master/ui/artalk/src/i18n/zh-CN.ts) | +| 后台界面 | [/ui/artalk-sidebar/src/i18n/[LANG].ts](https://github.com/ArtalkJS/Artalk/blob/master/ui/artalk-sidebar/src/i18n) | [zh-CN.ts](https://github.com/ArtalkJS/Artalk/blob/master/ui/artalk-sidebar/src/i18n/zh-CN.ts) | | 配置文件 | [/conf/artalk.example.[LANG].yml](https://github.com/ArtalkJS/Artalk/tree/master/conf) | [artalk.example.zh-CN.yml](https://github.com/ArtalkJS/Artalk/blob/master/conf/artalk.example.zh-CN.yml) | | 说明文档 | [/docs/[LANG]/\*\*/\*.md](https://github.com/ArtalkJS/Artalk/tree/master/docs) | [/docs/\*\*/\*.md](https://github.com/ArtalkJS/Artalk/tree/master/docs) | diff --git a/ui/artalk-sidebar/src/App.vue b/ui/artalk-sidebar/src/App.vue index 38c30f13..ba1b5220 100644 --- a/ui/artalk-sidebar/src/App.vue +++ b/ui/artalk-sidebar/src/App.vue @@ -1,87 +1,11 @@