@@ -7,6 +7,7 @@ import nanoid from 'nanoid';
77import Button from './Button' ;
88import TreeNode from './TreeNode' ;
99import iconsShape from './iconsShape' ;
10+ import languageShape from './languageShape' ;
1011import listShape from './listShape' ;
1112import nodeShape from './nodeShape' ;
1213
@@ -20,6 +21,7 @@ class CheckboxTree extends React.Component {
2021 expandOnClick : PropTypes . bool ,
2122 expanded : listShape ,
2223 icons : iconsShape ,
24+ lang : languageShape ,
2325 name : PropTypes . string ,
2426 nameAsArray : PropTypes . bool ,
2527 nativeCheckboxes : PropTypes . bool ,
@@ -52,6 +54,11 @@ class CheckboxTree extends React.Component {
5254 parentOpen : < span className = "rct-icon rct-icon-parent-open" /> ,
5355 leaf : < span className = "rct-icon rct-icon-leaf" /> ,
5456 } ,
57+ lang : {
58+ collapseAll : 'Collapse all' ,
59+ expandAll : 'Expand all' ,
60+ toggle : 'Toggle' ,
61+ } ,
5562 name : undefined ,
5663 nameAsArray : false ,
5764 nativeCheckboxes : false ,
@@ -264,6 +271,7 @@ class CheckboxTree extends React.Component {
264271 expandDisabled,
265272 expandOnClick,
266273 icons,
274+ lang,
267275 noCascade,
268276 onlyLeafCheckboxes,
269277 optimisticToggle,
@@ -293,6 +301,7 @@ class CheckboxTree extends React.Component {
293301 icon = { node . icon }
294302 icons = { { ...defaultIcons , ...icons } }
295303 label = { node . label }
304+ lang = { lang }
296305 optimisticToggle = { optimisticToggle }
297306 rawChildren = { node . children }
298307 showCheckbox = { showCheckbox }
@@ -325,7 +334,7 @@ class CheckboxTree extends React.Component {
325334 }
326335
327336 renderExpandAll ( ) {
328- const { icons : { expandAll, collapseAll } , showExpandAll } = this . props ;
337+ const { icons : { expandAll, collapseAll } , lang , showExpandAll } = this . props ;
329338
330339 if ( ! showExpandAll ) {
331340 return null ;
@@ -335,14 +344,14 @@ class CheckboxTree extends React.Component {
335344 < div className = "rct-options" >
336345 < Button
337346 className = "rct-option rct-option-expand-all"
338- title = "Expand all"
347+ title = { lang . expandAll }
339348 onClick = { this . onExpandAll }
340349 >
341350 { expandAll }
342351 </ Button >
343352 < Button
344353 className = "rct-option rct-option-collapse-all"
345- title = "Collapse all"
354+ title = { lang . collapseAll }
346355 onClick = { this . onCollapseAll }
347356 >
348357 { collapseAll }
0 commit comments