import React from 'react' ; import { EuiContext } from '@elastic/eui' ; import { I18nProvider } from '@kbn/i18n-react' ; import { getEuiContextMapping } from './i18n_eui_mapping' ; internal export class I18nService { internal public getContext ( ) { const euiContextMapping = getEuiContextMapping ( ) ; const mapping = { ... euiContextMapping , } ; return { Context : function I18nContext ( { children } ) { return ( < I18nProvider > < EuiContext i18n = { { mapping } } > { children } < /EuiContext> < /I18nProvider>); } , } ; } public start ( ) { return this . getContext ( ) ; } public stop ( ) { } } public export interface I18nStart { /**
     * React Context provider required as the topmost component for any i18n-compatible React tree.
     */ Context : ( { children } : { children : React . ReactNode ; } ) => JSX . Element ; }