site: fix lang change in home page

pull/4505/head
Benjy Cui 8 years ago
parent 0187384445
commit 435eed2e23

@ -42,8 +42,12 @@ export default class Header extends React.Component {
handleLangChange = () => {
const pathname = this.props.location.pathname;
if (pathname === '/') {
location.pathname = utils.getLocalizedPathname(pathname, !utils.isZhCN(pathname));
} else {
location.href = location.href.replace(location.pathname, utils.getLocalizedPathname(pathname, !utils.isZhCN(pathname)));
}
}
render() {
const { location, picked, isFirstScreen } = this.props;

Loading…
Cancel
Save