feat: 统一官网多语言链接规则

This commit is contained in:
digua
2026-04-09 20:51:24 +08:00
committed by digua
parent d7a02a10c2
commit 0b89076e40
6 changed files with 32 additions and 35 deletions
+6 -6
View File
@@ -6,7 +6,7 @@ AI Agent でチャット履歴をローカル分析し、あなたのソーシ
[English](../README.md) | [简体中文](./README.zh-CN.md) | [繁體中文](./README.zh-TW.md) | 日本語
[公式サイト](https://chatlab.fun/ja/) · [ダウンロードガイド](https://chatlab.fun/ja/?type=download) · [ドキュメント](https://chatlab.fun/ja/usage/) · [Roadmap](https://chatlabfun.featurebase.app/roadmap) · [Issue](https://github.com/hellodigua/ChatLab/issues)
[公式サイト](https://chatlab.fun/) · [ダウンロードガイド](https://chatlab.fun/?type=download) · [ドキュメント](https://chatlab.fun/usage/) · [Roadmap](https://chatlabfun.featurebase.app/roadmap) · [Issue](https://github.com/hellodigua/ChatLab/issues)
</div>
@@ -24,14 +24,14 @@ ChatLab は、チャット履歴を深く理解するためのローカル完結
## ガイド
- [ChatLab ダウンロードガイド](https://chatlab.fun/ja/?type=download)
- [チャット履歴の書き出しガイド](https://chatlab.fun/ja/usage/how-to-export.html)
- [標準フォーマット仕様](https://chatlab.fun/ja/standard/chatlab-format.html)
- [トラブルシューティング](https://chatlab.fun/ja/usage/troubleshooting.html)
- [ChatLab ダウンロードガイド](https://chatlab.fun/?type=download)
- [チャット履歴の書き出しガイド](https://chatlab.fun/usage/how-to-export.html)
- [標準フォーマット仕様](https://chatlab.fun/standard/chatlab-format.html)
- [トラブルシューティング](https://chatlab.fun/usage/troubleshooting.html)
## プレビュー
その他の画面は公式サイト [chatlab.fun](https://chatlab.fun/ja/) を参照してください。
その他の画面は公式サイト [chatlab.fun](https://chatlab.fun/) を参照してください。
![Preview Interface](../public/images/intro_en.png)
+6 -6
View File
@@ -6,7 +6,7 @@
[English](../README.md) | [简体中文](./README.zh-CN.md) | 繁體中文 | [日本語](./README.ja-JP.md)
[官網](https://chatlab.fun/tw/) · [下載指南](https://chatlab.fun/tw/?type=download) · [使用文件](https://chatlab.fun/tw/usage/) · [Roadmap](https://chatlabfun.featurebase.app/roadmap) · [問題回報](https://github.com/hellodigua/ChatLab/issues)
[官網](https://chatlab.fun/cn/) · [下載指南](https://chatlab.fun/cn/?type=download) · [使用文件](https://chatlab.fun/cn/usage/) · [Roadmap](https://chatlabfun.featurebase.app/roadmap) · [問題回報](https://github.com/hellodigua/ChatLab/issues)
</div>
@@ -24,14 +24,14 @@ ChatLab 是一款專注於社交記錄分析的本機應用。結合 AI Agent
## 使用指南
- [下載 ChatLab 指南](https://chatlab.fun/tw/?type=download)
- [匯出聊天記錄指南](https://chatlab.fun/tw/usage/how-to-export.html)
- [標準化格式規範](https://chatlab.fun/tw/standard/chatlab-format.html)
- [疑難排解指南](https://chatlab.fun/tw/usage/troubleshooting.html)
- [下載 ChatLab 指南](https://chatlab.fun/cn/?type=download)
- [匯出聊天記錄指南](https://chatlab.fun/cn/usage/how-to-export.html)
- [標準化格式規範](https://chatlab.fun/cn/standard/chatlab-format.html)
- [疑難排解指南](https://chatlab.fun/cn/usage/troubleshooting.html)
## 預覽畫面
更多畫面請前往官網 [chatlab.fun](https://chatlab.fun/tw/)
更多畫面請前往官網 [chatlab.fun](https://chatlab.fun/cn/)
![預覽畫面](../public/images/intro_zh.png)
+8 -3
View File
@@ -497,13 +497,18 @@ export function registerAIHandlers({ win }: IpcContext): void {
ipcMain.handle(
'llm:validateApiKey',
async (_, provider: llm.LLMProvider, apiKey: string, baseUrl?: string, model?: string) => {
console.log('[LLM:validateApiKey] Validating:', { provider, baseUrl, model, apiKeyLength: apiKey?.length })
aiLogger.info('IPC', 'llm:validateApiKey validating', {
provider,
baseUrl,
model,
apiKeyLength: apiKey?.length,
})
try {
const result = await llm.validateApiKey(provider, apiKey, baseUrl, model)
console.log('[LLM:validateApiKey] Result:', result)
aiLogger.info('IPC', 'llm:validateApiKey result', result)
return result
} catch (error) {
console.error('[LLM:validateApiKey] Validation failed:', error)
aiLogger.error('IPC', 'llm:validateApiKey failed', { error: String(error), provider, baseUrl, model })
const errorMessage = error instanceof Error ? error.message : String(error)
return { success: false, error: errorMessage }
}
+4 -8
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, watch, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
import { getChatlabSiteLocalePath } from '@/utils/chatlabSiteLocale'
import { storeToRefs } from 'pinia'
import { useSettingsStore } from '@/stores/settings'
import { sanitizeSummary } from '@/utils/sanitizeSummary'
@@ -84,14 +85,9 @@ interface ChangelogItem {
const changelogs = ref<ChangelogItem[]>([])
function getChangelogUrl(lang: string) {
const langPathMap: Record<string, string> = {
'zh-CN': 'cn',
'zh-TW': 'tw',
'en-US': 'en',
'ja-JP': 'ja',
}
const langPath = langPathMap[lang] ?? 'en'
return `https://chatlab.fun/${langPath}/changelogs.json`
const localePath = getChatlabSiteLocalePath(lang)
const langPath = localePath ? `/${localePath}` : ''
return `https://chatlab.fun${langPath}/changelogs.json`
}
// 从服务端获取 changelog 数据
+5 -10
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, computed, onMounted, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { getChatlabSiteLocalePath } from '@/utils/chatlabSiteLocale'
const emit = defineEmits<{
openChangelog: []
@@ -11,16 +12,10 @@ const { t, locale } = useI18n()
// 配置 URL 根据语言动态获取
const CONFIG_BASE_URL = 'https://chatlab.fun'
const langPathMap: Record<string, string> = {
'zh-CN': 'cn',
'zh-TW': 'tw',
'en-US': 'en',
'ja-JP': 'ja',
}
const configUrl = computed(() => {
const langPath = langPathMap[locale.value] ?? 'en'
return `${CONFIG_BASE_URL}/${langPath}/config.json`
const localePath = getChatlabSiteLocalePath(locale.value)
const langPath = localePath ? `/${localePath}` : ''
return `${CONFIG_BASE_URL}${langPath}/config.json`
})
// 存储 key 也根据语言区分
@@ -42,7 +37,7 @@ function getDefaultLinks(): FooterLink[] {
id: 'website',
icon: 'i-heroicons-globe-alt',
title: t('home.footer.website'),
url: `https://chatlab.fun/${langPathMap[locale.value] ?? 'en'}/`,
url: `https://chatlab.fun${getChatlabSiteLocalePath(locale.value) ? `/${getChatlabSiteLocalePath(locale.value)}` : ''}/`,
},
{
id: 'github',
+3 -2
View File
@@ -6,6 +6,7 @@ import { storeToRefs } from 'pinia'
import { ref, computed } from 'vue'
import { useRouter } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { getChatlabSiteLocalePath } from '@/utils/chatlabSiteLocale'
import { useSessionStore, type BatchFileInfo, type MergeFileInfo } from '@/stores/session'
const { t } = useI18n()
@@ -333,8 +334,8 @@ async function handleGoToSession(sessionId: string) {
// 教程链接:根据语言动态生成
const tutorialUrl = computed(() => {
const { locale } = useI18n()
const pathMap: Record<string, string> = { 'zh-CN': '/cn', 'zh-TW': '/tw', 'ja-JP': '/ja' }
const langPath = pathMap[locale.value] ?? ''
const localePath = getChatlabSiteLocalePath(locale.value)
const langPath = localePath ? `/${localePath}` : ''
return `https://chatlab.fun${langPath}/usage/how-to-export.html?utm_source=app`
})