diff options
author | talig <talig@amdocs.com> | 2017-12-20 14:30:43 +0200 |
---|---|---|
committer | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | 2017-12-21 11:12:33 +0000 |
commit | 8e9c0653dd6c6862123c9609ae34e1206d86456e (patch) | |
tree | 5eeef00ec0677133baa439ca8d7ffd7aca4804b6 /openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js | |
parent | 785ebcc95de3e064e843bec04ba7a209d854fc7c (diff) |
Add collaboration feature
Issue-ID: SDC-767
Change-Id: I14fb4c1f54086ed03a56a7ff7fab9ecd40381795
Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js')
-rw-r--r-- | openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js b/openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js new file mode 100644 index 0000000000..816915b1c9 --- /dev/null +++ b/openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js @@ -0,0 +1,35 @@ +import React from 'react'; +import {storiesOf, action} from '@kadira/storybook'; +import {text, number} from '@kadira/storybook-addon-knobs'; +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', () => { + let keys = [ + 'I do not exist', + 'Delete', + 'OrchestrationTemplateCandidate/File Structure' + ]; + let translations = []; + let i=0; + translations.push(<div id={i++}>KEY: VALUE</div>) + keys.forEach((key) => { + translations.push((<div id={i++}>{key} : {i18n(key)} </div>)); + }); + var param = 'param'; + translations.push((<div id={i++}>added : {i18n('added')} </div>)); + translations.push((<div id={i++}><font color="red"><b>WRONG</b></font> - added with ${param} in translation : {i18n(`added with ${param}`)} </div>)); + translations.push((<div id={i++}><font color="green"><b>RIGHT</b></font> - added with ${param} and options object {JSON.stringify({param:param})}: {i18n('added with {param}', {param: param})} </div>)); + + return (<div>{translations}</div>); + }) +; |