. . .
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'
Generated using TypeDoc
. . .
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'
. . .