chore: update deps

This commit is contained in:
vben
2024-07-20 23:01:49 +08:00
parent a897929ea7
commit a1a566cb2f
12 changed files with 247 additions and 73 deletions

View File

@@ -0,0 +1,3 @@
# locale
每个app使用的国际化可能不同这里用于扩展国际化的功能例如扩展 dayjs、antd组件库的多语言切换以及app本身的国际化文件。

View File

@@ -5,10 +5,11 @@ import { ref } from 'vue';
import { $t, loadLocalesMap, setupI18n } from '@vben-core/locales';
import defaultLocale from 'ant-design-vue/es/locale/zh_CN';
import antdEnLocale from 'ant-design-vue/es/locale/en_US';
import antdDefaultLocale from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
const antdLocale = ref<Locale>(defaultLocale);
const antdLocale = ref<Locale>(antdDefaultLocale);
const modules = import.meta.glob('./langs/*.json');
@@ -65,13 +66,11 @@ async function loadDayjsLocale(lang: SupportedLanguagesType) {
async function loadAntdLocale(lang: SupportedLanguagesType) {
switch (lang) {
case 'zh-CN': {
antdLocale.value = defaultLocale;
antdLocale.value = antdDefaultLocale;
break;
}
case 'en-US': {
antdLocale.value = (await import(
'ant-design-vue/es/locale/en_US'
)) as unknown as Locale;
antdLocale.value = antdEnLocale;
break;
}
}

View File

@@ -17,7 +17,7 @@ const routes: RouteRecordRaw[] = [
children: [
{
name: 'Analytics',
path: '/analytics',
path: 'analytics',
component: () => import('#/views/dashboard/analytics/index.vue'),
meta: {
affixTab: true,
@@ -27,7 +27,7 @@ const routes: RouteRecordRaw[] = [
},
{
name: 'Workspace',
path: '/workspace',
path: 'workspace',
component: () => import('#/views/dashboard/workspace/index.vue'),
meta: {
title: $t('page.dashboard.workspace'),