import i18next , { TFunction } from 'i18next' ; import enUS from './locales/en-US' ; export async function setupi18n ( ) { await i18next . init ( { lng : 'en-US' , fallbackLng : 'en-US' , resources : { 'en-US' : { translation : enUS , } , } as any , interpolation : { format ( value , format , _lng ) { if ( value === undefined ) { return value ; } if ( format === 'uppercase' ) { return value . toUpperCase ( ) ; } if ( format === 'lowercase' ) { return value . toLowerCase ( ) ; } return value ; } , } as any , } ) ; } export function changeLanguage ( language ) { return i18next . changeLanguage ( language ) ; } export function t ( key , options ? ) { return i18next . t ( key , options ) ; }