You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
242 B
TypeScript
17 lines
242 B
TypeScript
|
8 months ago
|
import en from '../locale/en'
|
||
|
|
import zh from '../locale/zh-Hans'
|
||
|
|
const messages = {
|
||
|
|
en,
|
||
|
|
zh,
|
||
|
|
}
|
||
|
|
const localeMap = {
|
||
|
|
'zh-Hans': 'zh',
|
||
|
|
'zh-Hant': 'zh',
|
||
|
|
en: 'en',
|
||
|
|
}
|
||
|
|
|
||
|
|
export const t = (key: string) => {
|
||
|
|
// @ts-ignore
|
||
|
|
return zh[key]
|
||
|
|
}
|