docs: add English translate

pull/4600/head
linkscope 7 months ago
parent b7e3286f92
commit 429e592332

@ -43,7 +43,7 @@ export default defineConfig({
provider: 'local',
options: {
locales: {
zh: { // make this `root` if you want to translate the default locale
zh: {
translations: {
button: {
buttonText: '搜索',
@ -73,6 +73,43 @@ export default defineConfig({
})
```
If you only want to translate the default language, you can configure it like this:
```ts
import { defineConfig } from 'vitepress'
export default defineConfig({
themeConfig: {
search: {
provider: 'local',
options: {
translations: {
button: {
buttonText: '搜索',
buttonAriaLabel: '搜索'
},
modal: {
displayDetails: '显示详细列表',
resetButtonTitle: '重置搜索',
backButtonTitle: '关闭搜索',
noResultsText: '没有结果',
footer: {
selectText: '选择',
selectKeyAriaLabel: '输入',
navigateText: '导航',
navigateUpKeyAriaLabel: '上箭头',
navigateDownKeyAriaLabel: '下箭头',
closeText: '关闭',
closeKeyAriaLabel: 'esc'
}
}
}
}
}
}
})
```
### miniSearch options
You can configure MiniSearch like this:

Loading…
Cancel
Save