chore(i18n): resolve ts type error
parent
1092addb5e
commit
21e51d128d
|
@ -38,9 +38,14 @@ export function useI18n(namespace?: string): {
|
||||||
const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => {
|
const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => {
|
||||||
if (!key)
|
if (!key)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
if (!key.includes('.') && !namespace)
|
if (!key.includes('.') && !namespace)
|
||||||
return key
|
return key
|
||||||
return t(getKey(namespace, key), ...(arg as I18nTranslationRestParameters))
|
|
||||||
|
return (t as (arg0: string, ...arg: I18nTranslationRestParameters) => string)(
|
||||||
|
getKey(namespace, key),
|
||||||
|
...(arg as I18nTranslationRestParameters),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...methods,
|
...methods,
|
||||||
|
|
Loading…
Reference in New Issue