@@ -8,25 +8,6 @@ import createTranslate from 'rt/helpers/createTranslate'
88
99const smallData = require ( './data/data-sort' )
1010
11- const TEXTS = {
12- "Add another lane" : "NEW LANE" ,
13- "Click to add card" : "Click to add card" ,
14- "Delete lane" : "Delete lane" ,
15- "Lane actions" : "Lane actions" ,
16- "button" : {
17- "Add lane" : "Add lane" ,
18- "Add card" : "Add card" ,
19- "Cancel" : "Cancel"
20- } ,
21- "placeholder" : {
22- "title" : "title" ,
23- "description" : "description" ,
24- "label" : "label"
25- }
26- }
27-
28- const customTranslation = createTranslate ( TEXTS )
29-
3011const I18nBoard = ( ) => {
3112 const { t } = useTranslation ( )
3213 return (
@@ -41,12 +22,55 @@ const I18nBoard = () => {
4122}
4223
4324storiesOf ( 'I18n' , module )
44- . addDecorator ( story => < I18nextProvider i18n = { i18n } > { story ( ) } </ I18nextProvider > )
4525 . add (
4626 'Custom texts' ,
47- ( ) => < Board data = { smallData } t = { customTranslation } editable canAddLanes draggable /> ,
27+ ( ) => {
28+
29+ const TEXTS = {
30+ "Add another lane" : "NEW LANE" ,
31+ "Click to add card" : "Click to add card" ,
32+ "Delete lane" : "Delete lane" ,
33+ "Lane actions" : "Lane actions" ,
34+ "button" : {
35+ "Add lane" : "Add lane" ,
36+ "Add card" : "Add card" ,
37+ "Cancel" : "Cancel"
38+ } ,
39+ "placeholder" : {
40+ "title" : "title" ,
41+ "description" : "description" ,
42+ "label" : "label"
43+ }
44+ }
45+
46+ const customTranslation = createTranslate ( TEXTS )
47+ return < Board data = { smallData } t = { customTranslation } editable canAddLanes draggable />
48+ } ,
4849 { info : 'Have custom text titles' }
4950 )
51+ . add (
52+ 'Flat translation table' ,
53+ ( ) => {
54+ const FLAT_TRANSLATION_TABLE = {
55+ "Add another lane" : "+ Weitere Liste erstellen" ,
56+ "Click to add card" : "Klicken zum Erstellen einer Karte" ,
57+ "Delete lane" : "Liste löschen" ,
58+ "Lane actions" : "Listenaktionen" ,
59+ "button.Add lane" : "Liste hinzufügen" ,
60+ "button.Add card" : "Karte hinzufügen" ,
61+ "button.Cancel" : "Abbrechen" ,
62+ "placeholder.title" : "Titel" ,
63+ "placeholder.description" : "Beschreibung" ,
64+ "placeholder.label" : "Label"
65+ } ;
66+
67+ return < Board data = { smallData } t = { key => FLAT_TRANSLATION_TABLE [ key ] } editable canAddLanes draggable />
68+ } ,
69+ { info : 'Flat translation table' }
70+ )
71+
72+ storiesOf ( 'I18n' , module )
73+ . addDecorator ( story => < I18nextProvider i18n = { i18n } > { story ( ) } </ I18nextProvider > )
5074 . add (
5175 'Using i18next' ,
5276 ( ) => < I18nBoard /> ,
0 commit comments