🐛fix: remove unused exports from i18n index and ensure translate function returns correct type (#5419)
This commit is contained in:
parent
565c7412c2
commit
e9b28c5a90
@ -2,7 +2,7 @@
|
||||
export { default as i18n, loadTranslations } from './setup'
|
||||
|
||||
// Export the React context and hook
|
||||
export { TranslationProvider, useAppTranslation, TranslationContext } from './TranslationContext'
|
||||
export { TranslationProvider } from './TranslationContext'
|
||||
|
||||
// Export types
|
||||
export type { I18nInstance, TranslationResources } from './setup'
|
||||
@ -82,7 +82,7 @@ const translate = (key: string, options: Record<string, unknown> = {}): string =
|
||||
return current && typeof current === 'object' && current !== null && key in current
|
||||
? (current as Record<string, unknown>)[key]
|
||||
: undefined
|
||||
}, obj as unknown)
|
||||
}, obj as unknown) as string | undefined
|
||||
}
|
||||
|
||||
// Try to get translation from current language
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user