🐛fix: remove unused exports from i18n index and ensure translate function returns correct type (#5419)

This commit is contained in:
Sam Hoang Van 2025-06-21 14:42:15 +07:00 committed by GitHub
parent 565c7412c2
commit e9b28c5a90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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'

View File

@ -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