-
Notifications
You must be signed in to change notification settings - Fork 4.7k
chore(feat): localize 404 page (fix #1987) #2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
c691d8e
91cdec9
114b5da
893ccdd
6055fda
904279b
44ac63c
fe1c9e4
ef1f1fb
be17f34
5a39452
15f6feb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,13 +21,27 @@ module.exports = { | |
label: 'English', | ||
selectText: 'Languages', | ||
editLinkText: 'Edit this page on GitHub', | ||
lastUpdated: 'Last Updated' | ||
lastUpdated: 'Last Updated', | ||
notFoundLinkText: 'Take me home.', | ||
notFoundMessages: [ | ||
sybers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`There's nothing here.`, | ||
`How did we get here?`, | ||
`That's a Four-Oh-Four.`, | ||
`Looks like we've got some broken links.` | ||
] | ||
}, | ||
'/zh/': { | ||
label: '简体中文', | ||
selectText: '选择语言', | ||
editLinkText: '在 GitHub 上编辑此页', | ||
lastUpdated: '上次更新', | ||
notFoundLinkText: 'Take me home.', | ||
notFoundMessages: [ | ||
sybers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`There's nothing here.`, | ||
`How did we get here?`, | ||
`That's a Four-Oh-Four.`, | ||
`Looks like we've got some broken links.` | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs translation. |
||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,13 +29,27 @@ export default { | |
"label": "English", | ||
"selectText": "Languages", | ||
"editLinkText": "Edit this page on GitHub", | ||
"lastUpdated": "Last Updated" | ||
"lastUpdated": "Last Updated", | ||
"notFoundLinkText": "Take me home.", | ||
"notFoundMessages": [ | ||
"There's nothing here.", | ||
"How did we get here?", | ||
"That's a Four-Oh-Four.", | ||
"Looks like we've got some broken links." | ||
] | ||
}, | ||
"/zh/": { | ||
"label": "简体中文", | ||
"selectText": "选择语言", | ||
"editLinkText": "在 GitHub 上编辑此页", | ||
"lastUpdated": "上次更新" | ||
"lastUpdated": "上次更新", | ||
"notFoundLinkText": "Take me home.", | ||
"notFoundMessages": [ | ||
"There's nothing here.", | ||
"How did we get here?", | ||
"That's a Four-Oh-Four.", | ||
"Looks like we've got some broken links." | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs translation. |
||
} | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,13 @@ module.exports = ctx => ({ | |
selectText: 'Languages', | ||
ariaLabel: 'Select language', | ||
editLinkText: 'Edit this page on GitHub', | ||
notFoundLinkText: 'Take me home.', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to set this for the |
||
notFoundMessages: [ | ||
sybers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`There's nothing here.`, | ||
`How did we get here?`, | ||
`That's a Four-Oh-Four.`, | ||
`Looks like we've got some broken links.` | ||
], | ||
lastUpdated: 'Last Updated', | ||
nav: require('./nav/en'), | ||
sidebar: { | ||
|
@@ -56,6 +63,13 @@ module.exports = ctx => ({ | |
selectText: '选择语言', | ||
ariaLabel: "选择语言", | ||
editLinkText: '在 GitHub 上编辑此页', | ||
notFoundLinkText: 'Take me home.', | ||
notFoundMessages: [ | ||
sybers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`There's nothing here.`, | ||
`How did we get here?`, | ||
`That's a Four-Oh-Four.`, | ||
`Looks like we've got some broken links.` | ||
], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs translation. |
||
lastUpdated: '上次更新', | ||
nav: require('./nav/zh'), | ||
sidebar: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,7 +454,13 @@ module.exports = { | |
// default value is true. Allows to hide prev page links on all pages | ||
prevLinks: false, | ||
// custom text for edit link. Defaults to "Edit this page" | ||
editLinkText: 'Help us improve this page!' | ||
editLinkText: 'Help us improve this page!', | ||
|
||
// Optional options fot the 404 page | ||
|
||
// custom text for 404 page link. Defaults to "Take me home." | ||
notFoundLinkText: 'Take me home.', | ||
notFoundMessages: [/* ... */] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is important to write an example with the default values here, to let the user know what the default values are. |
||
} | ||
} | ||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,8 @@ module.exports = { | |
label: 'English', | ||
ariaLabel: 'Languages' | ||
editLinkText: 'Edit this page on GitHub', | ||
notFoundLinkText: 'Take me home.', | ||
notFoundMessages: [/* ... */], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here (to translate) |
||
serviceWorker: { | ||
updatePopup: { | ||
message: "New content is available.", | ||
|
@@ -76,6 +78,10 @@ module.exports = { | |
label: '简体中文', | ||
// 编辑链接文字 | ||
editLinkText: '在 GitHub 上编辑此页', | ||
// TODO: comment me | ||
notFoundLinkText: 'Take me home.', | ||
// TODO: comment me | ||
notFoundMessages: [/* ... */], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here (to translate) |
||
// Service Worker 的配置 | ||
serviceWorker: { | ||
updatePopup: { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you trying to solve with this condition? When would
this.$page.path
not be defined?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dzetah ?