Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "i18string"

Index

Type aliases

Diff

Diff: Diff<T, U>

I18StringProps

ObjectDiff

ObjectDiff: Pick<T, Diff<keyof T, keyof U>>

Variables

Const I18String

I18String: FunctionComponent<object> = withI18n(_I18String)

. . .

example

Usage of I18String is simple, after you have wrapped your app in the I18nSystem you can use them in place of regular strings

Note: I18String assumes the values provided and the keys of the locales are in english.

import I18String, {I18nSystem} from '@axc/react-components/display/i18string'




const MyComponent = ()=>{
     return(
        <I18String text='hello'/>
     )
}


const MyApp = ()=>{
     return(
         <I18nSystem localeData={locale: 'es', locales:{es:{hello:'hola'}}}>
             <MyComponent/>
         </I18nSystem>
     )
}

ReactDOM.render(<MyApp/>, document.getElementById('app'));

(locale): output:
 -----------------

(en): 'hello'

(es): 'hola'

. . .

Const I18nContext

I18nContext: Context<I18nContextData> = React.createContext<I18nContextData>(undefined)

Functions

withI18n

Generated using TypeDoc