lijianan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
.dumi/hooks/useLocale.ts
|
|
@ -9,6 +9,6 @@ export default function useLocale<Key extends string>( |
|
|
|
localeMap?: LocaleMap<Key>, |
|
|
|
): [Record<Key, string>, 'cn' | 'en'] { |
|
|
|
const { id } = useDumiLocale(); |
|
|
|
const localeType = id === 'zh-CN' ? 'cn' : ('en' as const); |
|
|
|
return [localeMap?.[localeType]!, localeType]; |
|
|
|
const localeType = id === 'zh-CN' ? 'cn' : 'en'; |
|
|
|
return [localeMap?.[localeType], localeType]; |
|
|
|
} |
|
|
|