mirror of
https://gitee.com/SuperManito/LinuxMirrors
synced 2025-11-03 07:50:28 +08:00
更新文档
This commit is contained in:
@@ -88,8 +88,8 @@
|
||||
--text-color-accent: var(--md-accent-fg-color);
|
||||
--text-color-inactive: #99989d;
|
||||
--text-color-reverse: #000;
|
||||
--background-color-primary: var(--md-default-bg-color--dark);
|
||||
--background-color-secondary: #1a1b20;
|
||||
--background-color-primary: var(--md-default-bg-color);
|
||||
--background-color-secondary: #101010;
|
||||
--background-color-tertiary: var(--md-accent-fg-color--transparent);
|
||||
--background-color-fourth: #2e2e2e;
|
||||
--background-color-reverse: #fff;
|
||||
@@ -102,7 +102,7 @@
|
||||
--icon-color-secondary: #dadada;
|
||||
--icon-color-tertiary: #838289;
|
||||
--icon-color-inactive: #99989d;
|
||||
--icon-color-reverse: var(--md-default-bg-color--dark);
|
||||
--icon-color-reverse: var(--md-default-bg-color);
|
||||
--shadow-color-primary: #000;
|
||||
--button-text-color-primary: #fbfbfb;
|
||||
--button-text-color-secondary: #99989d;
|
||||
@@ -119,4 +119,4 @@
|
||||
--chat-button-border-color-gradientSix: transparent;
|
||||
--chat-button-background-color-gradientOne: var(--md-accent-fg-color);
|
||||
--chat-button-background-color-gradientTwo: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,39 @@
|
||||
const OramaI18nData = {
|
||||
'zh-Hans': {
|
||||
searchPlaceholder: '请输入要搜索的内容...',
|
||||
chatPlaceholder: '有什么可以帮你的吗?',
|
||||
suggestions: ['如何使用', '支持哪些系统'],
|
||||
askAiText: '询问 AI',
|
||||
searchText: '搜索',
|
||||
toSelectText: '选择',
|
||||
toNavigateText: '导航',
|
||||
toCloseText: '关闭',
|
||||
},
|
||||
'zh-Hant': {
|
||||
searchPlaceholder: '請輸入要搜尋的內容...',
|
||||
chatPlaceholder: '有什麼可以幫你的嗎?',
|
||||
suggestions: ['如何使用', '支援哪些系統'],
|
||||
askAiText: '詢問 AI',
|
||||
searchText: '搜尋',
|
||||
toSelectText: '選擇',
|
||||
toNavigateText: '導航',
|
||||
toCloseText: '關閉',
|
||||
},
|
||||
en: {
|
||||
searchPlaceholder: 'Please enter the content to search...',
|
||||
chatPlaceholder: 'How can I help you?',
|
||||
suggestions: ['How to use', 'What systems are supported'],
|
||||
askAiText: 'Ask AI',
|
||||
searchText: 'Search',
|
||||
toSelectText: 'Select',
|
||||
toNavigateText: 'Navigate',
|
||||
toCloseText: 'Close',
|
||||
},
|
||||
}
|
||||
|
||||
// get search box config
|
||||
function getOramaSearchBoxConfig() {
|
||||
const isDefaultLang = window.location.pathname.includes('/zh-Hant') ? false : true
|
||||
const currentLang = window.location.pathname.includes('/zh-Hant') ? 'zh-Hant' : window.location.pathname.includes('/en') ? 'en' : 'zh-Hans'
|
||||
return {
|
||||
themeConfig: {
|
||||
// colors: {
|
||||
@@ -53,18 +86,18 @@ function getOramaSearchBoxConfig() {
|
||||
description: 'content',
|
||||
section: 'category',
|
||||
},
|
||||
searchPlaceholder: isDefaultLang ? '请输入要搜索的内容...' : '請輸入要搜尋的內容...',
|
||||
chatPlaceholder: isDefaultLang ? '有什么可以帮你的吗?' : '有什麼可以幫你的嗎?',
|
||||
suggestions: isDefaultLang ? ['如何使用', '支持哪些系统'] : ['如何使用', '支援哪些系統'],
|
||||
searchPlaceholder: OramaI18nData[currentLang].searchPlaceholder,
|
||||
chatPlaceholder: OramaI18nData[currentLang].chatPlaceholder,
|
||||
suggestions: OramaI18nData[currentLang].suggestions,
|
||||
}
|
||||
}
|
||||
|
||||
// localization search box component
|
||||
function localizationOramaSearchBox(searchBox) {
|
||||
if (!searchBox) return
|
||||
const isDefaultLang = window.location.pathname.includes('/zh-Hant') ? false : true
|
||||
const askAiText = isDefaultLang ? '询问 AI' : '詢問 AI'
|
||||
const searchText = isDefaultLang ? '搜索' : '搜尋'
|
||||
const currentLang = window.location.pathname.includes('/zh-Hant') ? 'zh-Hant' : window.location.pathname.includes('/en') ? 'en' : 'zh-Hans'
|
||||
const askAiText = OramaI18nData[currentLang].askAiText
|
||||
const searchText = OramaI18nData[currentLang].searchText
|
||||
const observer = new MutationObserver((mutations, obs) => {
|
||||
const shadowRoot = searchBox.shadowRoot
|
||||
if (shadowRoot) {
|
||||
@@ -77,9 +110,9 @@ function localizationOramaSearchBox(searchBox) {
|
||||
}
|
||||
}
|
||||
// Keyboard shortcuts localization (Only PC)
|
||||
const toSelectText = isDefaultLang ? '选择' : '選擇'
|
||||
const toNavigateText = isDefaultLang ? '导航' : '導航'
|
||||
const toCloseText = isDefaultLang ? '关闭' : '關閉'
|
||||
const toSelectText = OramaI18nData[currentLang].toSelectText
|
||||
const toNavigateText = OramaI18nData[currentLang].toNavigateText
|
||||
const toCloseText = OramaI18nData[currentLang].toCloseText
|
||||
const shortcutDescriptions = shadowRoot.querySelectorAll('.shortcut-description')
|
||||
shortcutDescriptions.forEach((element) => {
|
||||
if (element.textContent === 'to select' && element.textContent !== toSelectText) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user