refactor: refacotr preference

This commit is contained in:
vben
2024-06-01 23:15:29 +08:00
parent f7b97e8a83
commit fed47f5e05
139 changed files with 2205 additions and 1450 deletions

View File

@@ -50,6 +50,7 @@
},
"dependencies": {
"@intlify/core-base": "^9.13.1",
"@vben-core/preferences": "workspace:*",
"@vben-core/typings": "workspace:*",
"vue": "3.4.27",
"vue-i18n": "^9.13.1"

View File

@@ -1,4 +1,4 @@
import type { SupportLocale } from '@vben-core/typings';
import type { LocaleSupportType } from '@vben-core/typings';
import type { Locale } from 'vue-i18n';
@@ -44,7 +44,7 @@ function setI18nLanguage(locale: Locale) {
* Load locale messages
* @param lang
*/
async function loadLocaleMessages(lang: SupportLocale) {
async function loadLocaleMessages(lang: LocaleSupportType) {
if (unref(i18n.global.locale) === lang) {
return setI18nLanguage(lang);
}

View File

@@ -145,7 +145,7 @@ preference:
page-progress: Loading progress bar
page-transition: Page transition animation
copy: Copy Preferences
copy-success: Copy successful. Please replace in `src/preference.ts` of the app
copy-success: Copy successful. Please replace in `src/preferences.ts` of the app
reset-success: Preferences reset successfully
sidebar: Sidebar
side-visible: Display Sidebar

View File

@@ -144,7 +144,7 @@ preference:
page-progress: 加载进度条
page-transition: 页面切换动画
copy: 复制偏好设置
copy-success: 拷贝成功,请在 app 下的 `src/preference.ts`内进行覆盖
copy-success: 拷贝成功,请在 app 下的 `src/preferences.ts`内进行覆盖
reset-success: 重置偏好设置成功
sidebar: 侧边栏
side-visible: 显示侧边栏

View File

@@ -1,4 +1,4 @@
import type { SupportLocale } from '@vben-core/typings';
import type { LocaleSupportType } from '@vben-core/typings';
type ImportLocaleFn = () => Promise<{ default: Record<string, string> }>;
@@ -7,7 +7,7 @@ interface LocaleSetupOptions {
* Default language
* @default zh-CN
*/
defaultLocale?: SupportLocale;
defaultLocale?: LocaleSupportType;
}
export type { ImportLocaleFn, LocaleSetupOptions, SupportLocale };
export type { ImportLocaleFn, LocaleSetupOptions, LocaleSupportType };