mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-31 07:26:43 +00:00
fix: 🐛 修復 i18n 無法套用語言變體
修復 i18n 無法正確使用語言變體,轉而使用最靠近的語系翻譯
This commit is contained in:
@@ -15,7 +15,7 @@ const themes = scanSubdirectories(path.resolve(__dirname, 'themes'))
|
||||
const locales = (function () {
|
||||
// 根据BLOG_NOTION_PAGE_ID 检查支持多少种语言数据.
|
||||
// 支持如下格式配置多个语言的页面id xxx,zh:xxx,en:xxx
|
||||
const langs = [BLOG.LANG.slice(0, 2)]
|
||||
const langs = [BLOG.LANG]
|
||||
if (BLOG.NOTION_PAGE_ID.indexOf(',') > 0) {
|
||||
const siteIds = BLOG.NOTION_PAGE_ID.split(',')
|
||||
for (let index = 0; index < siteIds.length; index++) {
|
||||
@@ -84,15 +84,19 @@ const nextConfig = {
|
||||
eslint: {
|
||||
ignoreDuringBuilds: true
|
||||
},
|
||||
output: process.env.EXPORT ? 'export' : process.env.NEXT_BUILD_STANDALONE === 'true' ? 'standalone' : undefined,
|
||||
output: process.env.EXPORT
|
||||
? 'export'
|
||||
: process.env.NEXT_BUILD_STANDALONE === 'true'
|
||||
? 'standalone'
|
||||
: undefined,
|
||||
staticPageGenerationTimeout: 120,
|
||||
// 多语言, 在export时禁用
|
||||
i18n: process.env.EXPORT
|
||||
? undefined
|
||||
: {
|
||||
defaultLocale: BLOG.LANG.slice(0, 2),
|
||||
defaultLocale: BLOG.LANG,
|
||||
// 支持的所有多语言,按需填写即可
|
||||
locales
|
||||
locales: locales
|
||||
},
|
||||
images: {
|
||||
// 图片压缩
|
||||
|
||||
Reference in New Issue
Block a user