Переглянути джерело

uppy-react: Add `locale` props to all components.

René Kooi 8 роки тому
батько
коміт
9828733fb2

+ 7 - 1
src/uppy-react/Dashboard.js

@@ -14,6 +14,7 @@ class Dashboard extends React.Component {
     const uppy = this.props.uppy
     uppy.use(DashboardPlugin, {
       target: this.container,
+      locale: this.props.locale,
       maxWidth: this.props.maxWidth,
       maxHeight: this.props.maxHeight,
       semiTransparent: this.props.semiTransparent,
@@ -42,7 +43,12 @@ Dashboard.propTypes = {
   maxHeight: React.PropTypes.number,
   semiTransparent: React.PropTypes.bool,
   defaultTabIcon: React.PropTypes.node,
-  showProgressDetails: React.PropTypes.bool
+  showProgressDetails: React.PropTypes.bool,
+  locale: React.PropTypes.object
+}
+
+Dashboard.defaultProps = {
+  locale: {}
 }
 
 module.exports = Dashboard

+ 7 - 1
src/uppy-react/DashboardModal.js

@@ -14,6 +14,7 @@ class DashboardModal extends React.Component {
     const uppy = this.props.uppy
     uppy.use(ReactDashboardPlugin, {
       target: this.container,
+      locale: this.props.locale,
       maxWidth: this.props.maxWidth,
       maxHeight: this.props.maxHeight,
       semiTransparent: this.props.semiTransparent,
@@ -54,7 +55,12 @@ DashboardModal.propTypes = {
   semiTransparent: React.PropTypes.bool,
   defaultTabIcon: React.PropTypes.node,
   showProgressDetails: React.PropTypes.bool,
-  onRequestClose: React.PropTypes.func
+  onRequestClose: React.PropTypes.func,
+  locale: React.PropTypes.object
+}
+
+DashboardModal.defaultProps = {
+  locale: {}
 }
 
 module.exports = DashboardModal

+ 8 - 2
src/uppy-react/DragDrop.js

@@ -13,7 +13,8 @@ class DragDrop extends React.Component {
   componentDidMount () {
     const uppy = this.props.uppy
     uppy.use(DragDropPlugin, {
-      target: this.container
+      target: this.container,
+      locale: this.props.locale
     })
   }
 
@@ -27,7 +28,12 @@ class DragDrop extends React.Component {
 }
 
 DragDrop.propTypes = {
-  uppy: React.PropTypes.instanceOf(UppyCore).isRequired
+  uppy: React.PropTypes.instanceOf(UppyCore).isRequired,
+  locale: React.PropTypes.object
+}
+
+DragDrop.defaultProps = {
+  locale: {}
 }
 
 module.exports = DragDrop