mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-01 07:26:47 +00:00
fix: 🐛 修復 i18n 無法套用語言變體
修復 i18n 無法正確使用語言變體,轉而使用最靠近的語系翻譯
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { idToUuid } from 'notion-utils'
|
||||
import { checkStrIsNotionId, getLastPartOfUrl, isBrowser } from '../utils'
|
||||
import { loadLangFromLocalStorage } from '@/lib/lang'
|
||||
import { getCurrentLang } from '@/lib/lang'
|
||||
|
||||
/**
|
||||
* 处理页面内连接跳转:
|
||||
@@ -21,7 +21,7 @@ export const convertInnerUrl = allPages => {
|
||||
const { origin, pathname } = window.location;
|
||||
const currentURL = origin + pathname
|
||||
const currentPathLang = pathname.split('/').filter(Boolean)[0]
|
||||
const lang = loadLangFromLocalStorage().split(/[-_]/)[0]
|
||||
const lang = getCurrentLang
|
||||
const langPrefix = lang === currentPathLang ? '/' + lang : ''
|
||||
for (const anchorTag of allAnchorTags) {
|
||||
// url替换成slug
|
||||
|
||||
Reference in New Issue
Block a user