import { camelize , translate } from '../format/string' ; import locale from '../../locale' ; export function createI18N ( name ) { const prefix = name ? camelize ( name ) + '.' : '' ; return function ( path , ... args ) : string { const message = locale . t ( prefix + path ) || locale . t ( path ) ; return translate ( message , args ) ; } ; }