diff --git a/docs-vitepress/.vitepress/config.ts b/docs-vitepress/.vitepress/config.ts index a33b3513f..c80ea14d6 100644 --- a/docs-vitepress/.vitepress/config.ts +++ b/docs-vitepress/.vitepress/config.ts @@ -1,5 +1,6 @@ import { defineConfig } from "vitepress" import { withPwa } from "@vite-pwa/vitepress" +import { algoliaTranslations } from "./theme/translations" const sidebar = { "/guide/": [ @@ -207,55 +208,6 @@ const sidebar = { ], } -const algoliaTranslations = { - button: { - buttonText: "搜索", - }, - modal: { - searchBox: { - resetButtonTitle: "清除查询条件", - resetButtonAriaLabel: "清除查询条件", - cancelButtonText: "取消", - cancelButtonAriaLabel: "取消", - }, - startScreen: { - recentSearchesTitle: "搜索历史", - noRecentSearchesText: "没有搜索历史", - saveRecentSearchButtonTitle: "保存到搜索历史", - removeRecentSearchButtonTitle: "从搜索历史中移除", - favoriteSearchesTitle: "收藏", - removeFavoriteSearchButtonTitle: "从收藏中移除", - }, - errorScreen: { - titleText: "无法获取结果", - helpText: "你可能需要检查你的网络连接", - }, - footer: { - selectText: "选择", - navigateText: "切换", - closeText: "关闭", - searchByText: "搜索供应商", - }, - noResultsScreen: { - noResultsText: "无法找到相关结果", - suggestedQueryText: "你可以尝试查询", - reportMissingResultsText: "你认为这个查询应该有结果?", - reportMissingResultsLinkText: "向我们反馈", - }, - }, -} - -const i18n = { - search: '搜索', - menu: '菜单', - toc: '本页目录', - returnToTop: '返回顶部', - appearance: '外观', - previous: '前一篇', - next: '下一篇', - pageNotFound: '页面未找到', -} - const ogUrl = "https://mpxjs.cn/" const ogImage = `${ogUrl}logo.png` const title = "Mpx 框架" diff --git a/docs-vitepress/.vitepress/theme/components/AlgoliaSearchBox.vue b/docs-vitepress/.vitepress/theme/components/AlgoliaSearchBox.vue index f2a1cdd4b..59f59b5d9 100644 --- a/docs-vitepress/.vitepress/theme/components/AlgoliaSearchBox.vue +++ b/docs-vitepress/.vitepress/theme/components/AlgoliaSearchBox.vue @@ -8,6 +8,8 @@