-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dba45f
commit b951f3b
Showing
22 changed files
with
192 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** 德语 */ | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
|
||
export const deSearchLocale: Partial<SearchLocaleOptions> = { | ||
placeholder: 'Dokumente durchsuchen', | ||
resetButtonTitle: 'Suche zurücksetzen', | ||
backButtonTitle: 'Schließen', | ||
noResultsText: 'Keine Suchergebnisse:', | ||
footer: { | ||
selectText: 'Auswählen', | ||
selectKeyAriaLabel: 'Eingabe', | ||
navigateText: 'Wechseln', | ||
navigateUpKeyAriaLabel: 'Nach oben', | ||
navigateDownKeyAriaLabel: 'Nach unten', | ||
closeText: 'Schließen', | ||
closeKeyAriaLabel: 'Beenden', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
|
||
export const enSearchLocale: Partial<SearchLocaleOptions> = { | ||
placeholder: 'Search', | ||
resetButtonTitle: 'Reset search', | ||
backButtonTitle: 'Close search', | ||
noResultsText: 'No results for', | ||
footer: { | ||
selectText: 'to select', | ||
selectKeyAriaLabel: 'enter', | ||
navigateText: 'to navigate', | ||
navigateUpKeyAriaLabel: 'up arrow', | ||
navigateDownKeyAriaLabel: 'down arrow', | ||
closeText: 'to close', | ||
closeKeyAriaLabel: 'escape', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** 法语 */ | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
|
||
export const frSearchLocale: Partial<SearchLocaleOptions> = { | ||
placeholder: 'Rechercher dans la documentation', | ||
resetButtonTitle: 'Réinitialiser la recherche', | ||
backButtonTitle: 'Fermer', | ||
noResultsText: 'Aucun résultat trouvé :', | ||
footer: { | ||
selectText: 'sélectionner', | ||
selectKeyAriaLabel: 'Entrée', | ||
navigateText: 'naviguer', | ||
navigateUpKeyAriaLabel: 'haut', | ||
navigateDownKeyAriaLabel: 'bas', | ||
closeText: 'fermer', | ||
closeKeyAriaLabel: 'sortie', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* 多语言预设 | ||
* 除 /zh/ 、 /en/ 外,其它语言预设通过 AI 生成,不保证准确 | ||
* 如有错误,欢迎提 issue | ||
*/ | ||
import type { DefaultLocaleInfo } from '@vuepress/helper' | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
import { deSearchLocale } from './de.js' | ||
import { enSearchLocale } from './en.js' | ||
import { frSearchLocale } from './fr.js' | ||
import { jaSearchLocale } from './ja.js' | ||
import { ruSearchLocale } from './ru.js' | ||
import { zhTwSearchLocale } from './zh-tw.js' | ||
import { zhSearchLocale } from './zh.js' | ||
|
||
export const SEARCH_LOCALES: DefaultLocaleInfo<Partial<SearchLocaleOptions>> = [ | ||
[['en', 'en-US'], enSearchLocale], | ||
[['zh', 'zh-CN', 'zh-Hans', 'zh-Hant'], zhSearchLocale], | ||
[['zh-TW'], zhTwSearchLocale], | ||
[['de', 'de-DE'], deSearchLocale], | ||
[['fr', 'fr-FR'], frSearchLocale], | ||
[['ru', 'ru-RU'], ruSearchLocale], | ||
[['ja', 'ja-JP'], jaSearchLocale], | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** 日语 */ | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
|
||
export const jaSearchLocale: Partial<SearchLocaleOptions> = { | ||
placeholder: 'ドキュメントを検索', | ||
resetButtonTitle: '検索をリセット', | ||
backButtonTitle: '閉じる', | ||
noResultsText: '検索結果がありません:', | ||
footer: { | ||
selectText: '選択', | ||
selectKeyAriaLabel: '入力', | ||
navigateText: '切り替え', | ||
navigateUpKeyAriaLabel: '上へ', | ||
navigateDownKeyAriaLabel: '下へ', | ||
closeText: '閉じる', | ||
closeKeyAriaLabel: '終了', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** 俄语 */ | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
|
||
export const ruSearchLocale: Partial<SearchLocaleOptions> = { | ||
placeholder: 'Поиск по документации', | ||
resetButtonTitle: 'Сбросить поиск', | ||
backButtonTitle: 'Закрыть', | ||
noResultsText: 'Нет результатов поиска:', | ||
footer: { | ||
selectText: 'Выбрать', | ||
selectKeyAriaLabel: 'Ввод', | ||
navigateText: 'Переключить', | ||
navigateUpKeyAriaLabel: 'Вверх', | ||
navigateDownKeyAriaLabel: 'Вниз', | ||
closeText: 'Закрыть', | ||
closeKeyAriaLabel: 'Выход', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** 繁体中文 */ | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
|
||
export const zhTwSearchLocale: Partial<SearchLocaleOptions> = { | ||
placeholder: '搜索文檔', | ||
resetButtonTitle: '重置搜索', | ||
backButtonTitle: '關閉', | ||
noResultsText: '無搜索結果:', | ||
footer: { | ||
selectText: '選擇', | ||
selectKeyAriaLabel: '輸入', | ||
navigateText: '切換', | ||
navigateUpKeyAriaLabel: '向上', | ||
navigateDownKeyAriaLabel: '向下', | ||
closeText: '關閉', | ||
closeKeyAriaLabel: '退出', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { SearchLocaleOptions } from '../../shared/index.js' | ||
|
||
export const zhSearchLocale: Partial<SearchLocaleOptions> = { | ||
placeholder: '搜索文档', | ||
resetButtonTitle: '重置搜索', | ||
backButtonTitle: '关闭', | ||
noResultsText: '无搜索结果:', | ||
footer: { | ||
selectText: '选择', | ||
selectKeyAriaLabel: '输入', | ||
navigateText: '切换', | ||
navigateUpKeyAriaLabel: '向上', | ||
navigateDownKeyAriaLabel: '向下', | ||
closeText: '关闭', | ||
closeKeyAriaLabel: '退出', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
import type { App } from 'vuepress' | ||
import type { PlumeThemePluginOptions } from '../../shared/index.js' | ||
import { entries, fromEntries, getLocalePaths, inferRootLocalePath, isPlainObject } from '@vuepress/helper' | ||
import { getFullLocaleConfig, isPlainObject } from '@vuepress/helper' | ||
import { PRESET_LOCALES } from '../locales/index.js' | ||
|
||
export function resolveProvideData( | ||
app: App, | ||
plugins: PlumeThemePluginOptions, | ||
): Record<string, any> { | ||
const root = inferRootLocalePath(app) | ||
const locales = [...getLocalePaths(app), root] | ||
return { | ||
// 注入水印配置 | ||
__PLUME_WM_FP__: isPlainObject(plugins.watermark) | ||
? plugins.watermark.fullPage !== false | ||
: true, | ||
// 注入多语言配置 | ||
__PLUME_PRESET_LOCALE__: fromEntries( | ||
entries(PRESET_LOCALES) | ||
.filter(([locale]) => locales.includes(locale)) | ||
.map(([locale, value]) => [locale === root ? '/' : locale, value]), | ||
), | ||
__PLUME_PRESET_LOCALE__: getFullLocaleConfig({ | ||
app, | ||
name: 'vuepress-theme-plume/preset-locales', | ||
default: PRESET_LOCALES, | ||
}), | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.