From 7fdf733a64670fceefc3ded35cfa581e1c458179 Mon Sep 17 00:00:00 2001 From: Einav Weiss Keidar Date: Tue, 20 Mar 2018 14:45:40 +0200 Subject: Adding Prettier and fixing up eslint version Issue-ID: SDC-1094 Change-Id: Ie83ad95a03899345dd90235daf0323cbe3bc6afd Signed-off-by: Einav Weiss Keidar --- openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js | 64 +++++++++++++++--------- 1 file changed, 40 insertions(+), 24 deletions(-) (limited to 'openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js') diff --git a/openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js b/openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js index 816915b1c9..79f95057a0 100644 --- a/openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js +++ b/openecomp-ui/src/nfvo-utils/i18n/i18n.stories.js @@ -1,35 +1,51 @@ 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 { 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', () => { - let keys = [ - 'I do not exist', - 'Delete', - 'OrchestrationTemplateCandidate/File Structure' - ]; - let translations = []; - let i=0; - translations.push(
KEY: VALUE
) - keys.forEach((key) => { - translations.push((
{key} : {i18n(key)}
)); - }); - var param = 'param'; - translations.push((
added : {i18n('added')}
)); - translations.push((
WRONG - added with ${param} in translation : {i18n(`added with ${param}`)}
)); - translations.push((
RIGHT - added with ${param} and options object {JSON.stringify({param:param})}: {i18n('added with {param}', {param: param})}
)); +stories.add('i18n tests', () => { + let keys = [ + 'I do not exist', + 'Delete', + 'OrchestrationTemplateCandidate/File Structure' + ]; + let translations = []; + let i = 0; + translations.push(
KEY: VALUE
); + keys.forEach(key => { + translations.push( +
+ {key} : {i18n(key)}{' '} +
+ ); + }); + var param = 'param'; + translations.push(
added : {i18n('added')}
); + translations.push( +
+ + WRONG + {' '} + - added with ${param} in translation : {i18n(`added with ${param}`)}{' '} +
+ ); + translations.push( +
+ + RIGHT + {' '} + - added with ${param} and options object{' '} + {JSON.stringify({ param: param })}:{' '} + {i18n('added with {param}', { param: param })}{' '} +
+ ); - return (
{translations}
); - }) -; + return
{translations}
; +}); -- cgit 1.2.3-korg