File tree Expand file tree Collapse file tree
apps/storybook/.storybook
packages/ui/components/unpublished-entity Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import i18n from "i18next" ;
22import { initReactI18next } from "react-i18next" ;
33
4+ const ns = [ "common" ] ;
5+ const supportedLngs = [ "en" , "fr" ] ;
6+ const resources = ns . reduce ( ( acc , n ) => {
7+ supportedLngs . forEach ( ( lng ) => {
8+ if ( ! acc [ lng ] ) acc [ lng ] = { } ;
9+ acc [ lng ] = {
10+ ...acc [ lng ] ,
11+ [ n ] : require ( `../../web/public/static/locales/${ lng } /${ n } .json` ) ,
12+ } ;
13+ } ) ;
14+ return acc ;
15+ } , { } ) ;
16+
417i18n . use ( initReactI18next ) . init ( {
5- resources : [ ] ,
618 debug : true ,
19+ fallbackLng : "en" ,
20+ defaultNS : "common" ,
21+ ns,
22+ interpolation : {
23+ escapeValue : false ,
24+ } ,
25+ react : { useSuspense : true } ,
26+ resources,
727} ) ;
828
929export default i18n ;
Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ export const parameters = {
2121 push ( ) { } ,
2222 Provider : AppRouterContext . Provider ,
2323 } ,
24+ globals : {
25+ locale : "en" ,
26+ locales : {
27+ en : "English" ,
28+ fr : "Français" ,
29+ } ,
30+ } ,
31+ i18n,
2432} ;
2533
2634addDecorator ( ( storyFn ) => (
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ The `UnpublishedEntity` component consists of the following parts:
2525## UnpublishedEntity Story
2626
2727<Canvas >
28- <Story name = " UnpublishedEntity" >
29- { () => (
30- <VariantsTable titles = { [" Default" ]} columnMinWidth = { 100 } >
28+ <Story name = " UnpublishedEntity" args = { { name: " TeamExample " , teamSlug: " team-example " } } >
29+ { (args ) => (
30+ <VariantsTable titles = { [" Default" ]} columnMinWidth = { 150 } >
3131 <VariantRow >
32- <UnpublishedEntity />
32+ <UnpublishedEntity { ... args } />
3333 </VariantRow >
3434 </VariantsTable >
3535 )}
You can’t perform that action at this time.
0 commit comments