File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ Returns:
163163| ` icons ` | object | An object containing the mappings for the various icons and their components. See ** Changing the Default Icons** . | ` { ... } ` |
164164| ` iconsClass ` | string | A string that specifies which icons class to utilize. Currently, ` 'fa4' ` and ` 'fa5' ` are supported. | ` 'fa5' ` |
165165| ` id ` | string | A string to be used for the HTML ID of the rendered tree and its nodes. | ` null ` |
166- | ` lang ` | object | An object containing the language mappings for the various text elements. | ` { ... } ` |
166+ | ` lang ` | object | A key-value pairing of localized text. See [ ` src/js/lang/default.js ` ] [ lang-file ] for a list of keys. | ` { ... } ` |
167167| ` name ` | string | Optional name for the hidden ` <input> ` element. | ` undefined ` |
168168| ` nameAsArray ` | bool | If true, the hidden ` <input> ` will encode its values as an array rather than a joined string. | ` false ` |
169169| ` nativeCheckboxes ` | bool | If true, native browser checkboxes will be used instead of pseudo-checkbox icons. | ` false ` |
@@ -197,5 +197,6 @@ Individual nodes within the `nodes` property can have the following structure:
197197[ docs-controlled ] : https://facebook.github.io/react/docs/forms.html#controlled-components
198198[ docs-state-hooks ] : https://reactjs.org/docs/hooks-state.html
199199[ font-awesome ] : https://fontawesome.com
200+ [ lang-file ] : https://github.com/jakezatecky/react-dual-listbox/blob/master/src/js/lang/default.js
200201[ mdn-key ] : https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key
201202[ react-fontawesome ] : https://github.com/FortAwesome/react-fontawesome
Original file line number Diff line number Diff line change @@ -6,13 +6,14 @@ import PropTypes from 'prop-types';
66import React from 'react' ;
77
88import Button from './Button' ;
9- import { CHECK_MODEL , KEYS } from './constants' ;
109import NodeModel from './NodeModel' ;
1110import TreeNode from './TreeNode' ;
11+ import defaultLang from './lang/default' ;
1212import iconsShape from './shapes/iconsShape' ;
1313import languageShape from './shapes/languageShape' ;
1414import listShape from './shapes/listShape' ;
1515import nodeShape from './shapes/nodeShape' ;
16+ import { CHECK_MODEL , KEYS } from './constants' ;
1617
1718class CheckboxTree extends React . Component {
1819 static propTypes = {
@@ -67,11 +68,7 @@ class CheckboxTree extends React.Component {
6768 } ,
6869 iconsClass : 'fa5' ,
6970 id : null ,
70- lang : {
71- collapseAll : 'Collapse all' ,
72- expandAll : 'Expand all' ,
73- toggle : 'Toggle' ,
74- } ,
71+ lang : defaultLang ,
7572 name : undefined ,
7673 nameAsArray : false ,
7774 nativeCheckboxes : false ,
Original file line number Diff line number Diff line change 1+ export default {
2+ collapseAll : 'Collapse all' ,
3+ expandAll : 'Expand all' ,
4+ toggle : 'Toggle' ,
5+ } ;
You can’t perform that action at this time.
0 commit comments