You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
672 B
36 lines
672 B
9 years ago
|
import React from 'react';
|
||
9 years ago
|
import { changeConfirmLocale } from '../modal/locale';
|
||
9 years ago
|
|
||
|
export default class LocaleProvider extends React.Component {
|
||
9 years ago
|
static propTypes = {
|
||
|
locale: React.PropTypes.object,
|
||
|
}
|
||
|
|
||
|
static childContextTypes = {
|
||
|
antLocale: React.PropTypes.object,
|
||
|
}
|
||
|
|
||
9 years ago
|
getChildContext() {
|
||
|
return {
|
||
9 years ago
|
antLocale: this.props.locale,
|
||
9 years ago
|
};
|
||
|
}
|
||
9 years ago
|
|
||
9 years ago
|
componentDidMount() {
|
||
|
this.componentDidUpdate();
|
||
|
}
|
||
9 years ago
|
|
||
9 years ago
|
componentDidUpdate() {
|
||
|
const { locale } = this.props;
|
||
|
changeConfirmLocale(locale && locale.Modal);
|
||
|
}
|
||
9 years ago
|
|
||
9 years ago
|
componentWillUnMount() {
|
||
|
changeConfirmLocale();
|
||
|
}
|
||
9 years ago
|
|
||
9 years ago
|
render() {
|
||
9 years ago
|
return React.Children.only(this.props.children);
|
||
9 years ago
|
}
|
||
|
}
|