@@ -8,25 +8,6 @@ import createTranslate from 'rt/helpers/createTranslate'
8
8
9
9
const smallData = require ( './data/data-sort' )
10
10
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
-
30
11
const I18nBoard = ( ) => {
31
12
const { t } = useTranslation ( )
32
13
return (
@@ -41,12 +22,55 @@ const I18nBoard = () => {
41
22
}
42
23
43
24
storiesOf ( 'I18n' , module )
44
- . addDecorator ( story => < I18nextProvider i18n = { i18n } > { story ( ) } </ I18nextProvider > )
45
25
. add (
46
26
'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
+ } ,
48
49
{ info : 'Have custom text titles' }
49
50
)
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 > )
50
74
. add (
51
75
'Using i18next' ,
52
76
( ) => < I18nBoard /> ,
0 commit comments