| import React from 'react'; |
| import { storiesOf } from '@kadira/storybook'; |
| import { withKnobs } from '@kadira/storybook-addon-knobs'; |
| import i18n from 'nfvo-utils/i18n/i18n.js'; |
| import i18nJson from 'nfvo-utils/i18n/en.json'; |
| const stories = storiesOf('i18n', module); |
| stories.addDecorator(withKnobs); |
| i18nJson['added'] = 'this is my test'; |
| i18nJson['added with {param}'] = 'this is my test with {param}'; |
| stories.add('i18n tests', () => { |
| 'OrchestrationTemplateCandidate/File Structure' |
| translations.push(<div id={i++}>KEY: VALUE</div>); |
| translations.push(<div id={i++}>added : {i18n('added')} </div>); |
| - added with ${param} in translation : {i18n(`added with ${param}`)}{' '} |
| - added with ${param} and options object{' '} |
| {JSON.stringify({ param: param })}:{' '} |
| {i18n('added with {param}', { param: param })}{' '} |
| return <div>{translations}</div>; |