-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(projects): antd locale, dayjs locale
- Loading branch information
1 parent
388e504
commit 3b33ce9
Showing
14 changed files
with
78 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { Locale } from 'ant-design-vue/es/locale'; | ||
import zhCN from 'ant-design-vue/es/locale/zh_CN'; | ||
import enUS from 'ant-design-vue/es/locale/en_US'; | ||
|
||
export const antdLocales: Record<App.I18n.LangType, Locale> = { | ||
'zh-CN': zhCN, | ||
'en-US': enUS | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { locale } from 'dayjs'; | ||
import 'dayjs/locale/zh-cn'; | ||
import 'dayjs/locale/en'; | ||
import { localStg } from '@/utils/storage'; | ||
|
||
/** | ||
* set dayjs locale | ||
* @param lang | ||
*/ | ||
export function setDayjsLocale(lang: App.I18n.LangType = 'zh-CN') { | ||
const localMap = { | ||
'zh-CN': 'zh-cn', | ||
'en-US': 'en' | ||
} satisfies Record<App.I18n.LangType, string>; | ||
|
||
const l = lang || localStg.get('lang') || 'zh-CN'; | ||
|
||
locale(localMap[l]); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import zhCN from './lang/zh-CN'; | ||
import en from './lang/en'; | ||
import enUS from './lang/en-us'; | ||
|
||
const locales: Record<App.I18n.LangType, App.I18n.Schema> = { | ||
'zh-CN': zhCN, | ||
en | ||
'en-US': enUS | ||
}; | ||
|
||
export default locales; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { extend } from 'dayjs'; | ||
import localeData from 'dayjs/plugin/localeData'; | ||
import { setDayjsLocale } from '../locales/dayjs'; | ||
|
||
export function setupDayjs() { | ||
extend(localeData); | ||
|
||
setDayjsLocale(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './nprogress'; | ||
export * from './iconify'; | ||
export * from './dayjs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
<script setup lang="ts"></script> | ||
|
||
<template> | ||
<LookForward /> | ||
<div> | ||
<ACalendar :fullscreen="false" /> | ||
</div> | ||
</template> | ||
|
||
<style scoped></style> |