5 changed files with 91 additions and 5 deletions
@ -1,4 +1,5 @@ |
|||
export * from './api'; |
|||
export * from './components'; |
|||
export * from './hooks'; |
|||
export * from './locales'; |
|||
export * from './types'; |
|||
|
|||
@ -0,0 +1,20 @@ |
|||
import type { SupportedLanguagesType } from '@vben/locales'; |
|||
|
|||
import { loadLocalesMapFromDir } from '@vben/locales'; |
|||
|
|||
const modules = import.meta.glob('./langs/**/*.json'); |
|||
|
|||
const localesMap = loadLocalesMapFromDir( |
|||
/\.\/langs\/([^/]+)\/(.*)\.json$/, |
|||
modules, |
|||
); |
|||
|
|||
/** |
|||
* 加载平台服务本地化资源 |
|||
* @param lang 当前语言 |
|||
* @returns 资源集合 |
|||
*/ |
|||
export async function loadPaltformMessages(lang: SupportedLanguagesType) { |
|||
const locales = localesMap[lang]?.(); |
|||
return locales; |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
{ |
|||
"header": { |
|||
"welcome": { |
|||
"atoon": "Good afternoon, {0}, pay attention to rest oh~", |
|||
"afternoon": "Good afternoon, {0}, relax in time, can improve work efficiency~", |
|||
"evening": "Good evening, {0}. Still at work? The off work~", |
|||
"morning": "Good morning, {0}. Begin your day~" |
|||
}, |
|||
"notifier": { |
|||
"title": "Notifier", |
|||
"count": "({0})" |
|||
} |
|||
}, |
|||
"content": { |
|||
"favoriteMenu": { |
|||
"title": "Favorite Menus", |
|||
"home": "Home", |
|||
"dashboard": "Dashboard", |
|||
"profile": "Personal Profile", |
|||
"settings": "Personal Settings", |
|||
"notifiers": "Notifiers" |
|||
}, |
|||
"trends": { |
|||
"title": "Latest News" |
|||
}, |
|||
"todo": { |
|||
"title": "Todo List" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
{ |
|||
"header": { |
|||
"welcome": { |
|||
"atoon": "中午好, {0}, 注意休息哦~", |
|||
"afternoon": "下午好, {0}, 适时放松,可以提高工作效率~", |
|||
"evening": "晚上好, {0}, 还在工作么?该下班了~", |
|||
"morning": "早安, {0}, 开始您一天的工作吧~" |
|||
}, |
|||
"notifier": { |
|||
"title": "通知", |
|||
"count": "({0})" |
|||
} |
|||
}, |
|||
"content": { |
|||
"favoriteMenu": { |
|||
"title": "常用", |
|||
"home": "首页", |
|||
"dashboard": "仪表盘", |
|||
"profile": "个人中心", |
|||
"settings": "个人设置", |
|||
"notifiers": "通知消息" |
|||
}, |
|||
"trends": { |
|||
"title": "最新消息" |
|||
}, |
|||
"todo": { |
|||
"title": "待办事项" |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue