diff --git a/components/SEO.js b/components/SEO.js index cd7d78c605e..7f0cc0c2ad6 100644 --- a/components/SEO.js +++ b/components/SEO.js @@ -247,7 +247,7 @@ const getSEOMeta = (props, router, locale) => { } case '/404': return { - title: `${siteInfo?.title} | 页面找不到啦`, + title: `${siteInfo?.title} | ${locale.NAV.PAGE_NOT_FOUND}`, image: `${siteInfo?.pageCover}` } case '/tag': diff --git a/lib/lang/en-US.js b/lib/lang/en-US.js index 1649c6d36af..7229a152012 100644 --- a/lib/lang/en-US.js +++ b/lib/lang/en-US.js @@ -17,7 +17,9 @@ export default { NAVIGATOR: 'NAV', ABOUT: 'About', MAIL: 'E-Mail', - ARCHIVE: 'Archive' + ARCHIVE: 'Archive', + PAGE_NOT_FOUND: 'Page Not Found', + PAGE_NOT_FOUND_REDIRECT: 'Page Not Found, Redirecting to Home Page...' }, COMMON: { THEME: 'Theme', diff --git a/lib/lang/zh-CN.js b/lib/lang/zh-CN.js index 265bb0c2f8f..f51b6ba57ae 100644 --- a/lib/lang/zh-CN.js +++ b/lib/lang/zh-CN.js @@ -17,7 +17,9 @@ export default { ABOUT: '关于', NAVIGATOR: '导航', MAIL: '邮箱', - ARCHIVE: '归档' + ARCHIVE: '归档', + PAGE_NOT_FOUND: '页面找不到啦', + PAGE_NOT_FOUND_REDIRECT: '页面无法加载,即将返回首页' }, COMMON: { THEME: 'Theme', diff --git a/themes/fukasawa/index.js b/themes/fukasawa/index.js index 5553167c402..4176ed1110a 100644 --- a/themes/fukasawa/index.js +++ b/themes/fukasawa/index.js @@ -215,6 +215,7 @@ const LayoutArchive = props => { */ const Layout404 = props => { const router = useRouter() + const { locale } = useGlobal() useEffect(() => { // 延时3秒如果加载失败就返回首页 setTimeout(() => { @@ -232,7 +233,7 @@ const Layout404 = props => {

404

-

页面无法加载,即将返回首页

+

{locale.NAV.PAGE_NOT_FOUND_REDIRECT}

diff --git a/themes/game/index.js b/themes/game/index.js index cd46246aa3d..07db77dfadf 100644 --- a/themes/game/index.js +++ b/themes/game/index.js @@ -354,6 +354,7 @@ const LayoutSlug = props => { */ const Layout404 = props => { const router = useRouter() + const { locale } = useGameGlobal() useEffect(() => { // 延时3秒如果加载失败就返回首页 setTimeout(() => { @@ -371,7 +372,7 @@ const Layout404 = props => {

404

-

页面无法加载,即将返回首页

+

{locale.NAV.PAGE_NOT_FOUND_REDIRECT}

diff --git a/themes/gitbook/index.js b/themes/gitbook/index.js index 2da36965995..13014b72830 100644 --- a/themes/gitbook/index.js +++ b/themes/gitbook/index.js @@ -438,6 +438,7 @@ const LayoutArchive = props => { */ const Layout404 = props => { const router = useRouter() + const { locale } = useGlobal() useEffect(() => { // 延时3秒如果加载失败就返回首页 setTimeout(() => { @@ -455,7 +456,7 @@ const Layout404 = props => {

404

-

页面无法加载,即将返回首页

+

{locale.NAV.PAGE_NOT_FOUND_REDIRECT}