diff --git a/site/theme/static/template.html b/site/theme/static/template.html index 77340a3bf884..cbca53922704 100644 --- a/site/theme/static/template.html +++ b/site/theme/static/template.html @@ -8,6 +8,44 @@ Ant Design - A UI Design Language + @@ -51,30 +89,6 @@
{{ content | safe }}
- diff --git a/site/theme/template/Layout/Header.jsx b/site/theme/template/Layout/Header.jsx index f4ed2d5710e1..a8014ff99248 100644 --- a/site/theme/template/Layout/Header.jsx +++ b/site/theme/template/Layout/Header.jsx @@ -78,6 +78,9 @@ export default class Header extends React.Component { handleLangChange = () => { const pathname = this.props.location.pathname; + if (window.localStorage) { + localStorage.setItem('locale', utils.isZhCN(pathname) ? 'en-US' : 'zh-CN'); + } if (pathname === '/') { location.pathname = utils.getLocalizedPathname(pathname, !utils.isZhCN(pathname)); } else {