mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-17 11:49:41 +08:00
docs: fix translation dropdown error (#4007)
This commit is contained in:
parent
6006e910aa
commit
7d581e0b53
@ -29,6 +29,11 @@ export const useTranslation = () => {
|
||||
const langsCopy = langs.slice(0)
|
||||
langsCopy.splice(langsCopy.indexOf(currentLang), 1)
|
||||
|
||||
// if current language is not zh-CN, then zh-CN needs to be moved to the head.
|
||||
if (currentLang !== 'zh-CN') {
|
||||
langsCopy.splice(langsCopy.indexOf('zh-CN'), 1)
|
||||
}
|
||||
|
||||
return currentLang === 'zh-CN' ? langsCopy : ['zh-CN'].concat(langsCopy)
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user