mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
site: fix safari language check (#5245)
This commit is contained in:
parent
82b54ad42a
commit
c8fdf3ebac
@ -50,7 +50,8 @@
|
||||
|
||||
// 首页无视链接里面的语言设置 https://github.com/ant-design/ant-design/issues/4552
|
||||
if (isLocalStorageNameSupported() && (pathname === '/' || pathname === '/index-cn')) {
|
||||
var lang = (window.localStorage && localStorage.getItem('locale')) || navigator.language;
|
||||
var lang = (window.localStorage && localStorage.getItem('locale')) || (navigator.language.toLowerCase() === 'zh-cn' ? 'zh-CN' : 'en-US');
|
||||
// safari is 'zh-cn', while other browser is 'zh-CN';
|
||||
if ((lang === 'zh-CN') !== isZhCN(pathname)) {
|
||||
location.pathname = getLocalizedPathname(pathname, lang === 'zh-CN');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user