feat(frontend): 添加 Gemini OAuth 类型国际化

- zh.ts: 添加中文翻译(Code Assist/AI Studio 选择等)
- en.ts: 添加英文翻译
This commit is contained in:
ianshaw
2025-12-25 21:25:08 -08:00
parent 09431cfc0b
commit 2d1a15b196
2 changed files with 85 additions and 58 deletions

View File

@@ -926,19 +926,23 @@ export default {
gemini: { gemini: {
title: 'Gemini Account Authorization', title: 'Gemini Account Authorization',
followSteps: 'Follow these steps to authorize your Gemini account:', followSteps: 'Follow these steps to authorize your Gemini account:',
step1GenerateUrl: 'Generate the authorization URL (requires a redirect URI)', step1GenerateUrl: 'Generate the authorization URL',
generateAuthUrl: 'Generate Auth URL', generateAuthUrl: 'Generate Auth URL',
projectIdLabel: 'Project ID (optional)',
projectIdPlaceholder: 'e.g. my-gcp-project or cloud-ai-companion-xxxxx',
projectIdHint:
'Leave empty to auto-detect after code exchange. If auto-detection fails, fill it in and re-generate the auth URL to try again.',
howToGetProjectId: 'How to get',
step2OpenUrl: 'Open the URL in your browser and complete authorization', step2OpenUrl: 'Open the URL in your browser and complete authorization',
openUrlDesc: openUrlDesc:
'Open the authorization URL in a new tab, log in to your Google account and authorize.', 'Open the authorization URL in a new tab, log in to your Google account and authorize.',
step3EnterCode: 'Enter Authorization URL or Code', step3EnterCode: 'Enter Authorization URL or Code',
authCodeDesc: authCodeDesc:
'After authorization, you will be redirected to the redirect URI with <code>code</code> and <code>state</code>. Paste the full URL or just the code below:', 'After authorization, copy the callback URL (recommended) or just the <code>code</code> and paste it below.',
authCode: 'Authorization URL or Code', authCode: 'Callback URL or Code',
authCodePlaceholder: authCodePlaceholder:
'Option 1: Paste the complete callback URL\n(https://your-domain/auth/callback?code=...&state=...)\nOption 2: Paste only the code value', 'Option 1 (recommended): Paste the callback URL\nOption 2: Paste only the code value',
authCodeHint: authCodeHint: 'The system will auto-extract code/state from the URL.',
'If you paste the full URL, the system will auto-extract code/state for you',
redirectUri: 'Redirect URI', redirectUri: 'Redirect URI',
redirectUriHint: redirectUriHint:
'This must be configured in your Google OAuth client and must match exactly.', 'This must be configured in your Google OAuth client and must match exactly.',
@@ -948,16 +952,27 @@ export default {
redirectUriNotConfirmed: 'Please confirm the Redirect URI is configured correctly', redirectUriNotConfirmed: 'Please confirm the Redirect URI is configured correctly',
missingRedirectUri: 'Missing redirect URI', missingRedirectUri: 'Missing redirect URI',
failedToGenerateUrl: 'Failed to generate Gemini auth URL', failedToGenerateUrl: 'Failed to generate Gemini auth URL',
missingExchangeParams: 'Missing auth code, session ID, state, or redirect URI', missingExchangeParams: 'Missing auth code, session ID, or state',
failedToExchangeCode: 'Failed to exchange Gemini auth code', failedToExchangeCode: 'Failed to exchange Gemini auth code',
modelPassthrough: 'Gemini Model Passthrough', modelPassthrough: 'Gemini Model Passthrough',
modelPassthroughDesc: modelPassthroughDesc:
'All model requests are forwarded directly to the Gemini API without model restrictions or mappings.', 'All model requests are forwarded directly to the Gemini API without model restrictions or mappings.',
stateWarningTitle: '⚠️ Important: Gemini requires both code and state', stateWarningTitle: 'Note',
stateWarningDesc: stateWarningDesc: 'Recommended: paste the full callback URL (includes code & state).',
'We recommend pasting the complete callback URL so the system can auto-extract both code and state. Pasting only the code will cause authorization to fail.' oauthTypeLabel: 'OAuth Type',
needsProjectId: 'For GCP Developers',
needsProjectIdDesc: 'Uses built-in client, requires GCP project',
noProjectIdNeeded: 'For Regular Users',
noProjectIdNeededDesc: 'Requires your own OAuth client'
} }
}, },
// Gemini specific (platform-wide)
gemini: {
modelPassthrough: 'Gemini Model Passthrough',
modelPassthroughDesc:
'All model requests are forwarded directly to the Gemini API without model restrictions or mappings.',
apiKeyHint: 'Your Gemini API Key (starts with AIza)'
},
// Re-Auth Modal // Re-Auth Modal
reAuthorizeAccount: 'Re-Authorize Account', reAuthorizeAccount: 'Re-Authorize Account',
claudeCodeAccount: 'Claude Code Account', claudeCodeAccount: 'Claude Code Account',
@@ -983,7 +998,7 @@ export default {
startingTestForAccount: 'Starting test for account: {name}', startingTestForAccount: 'Starting test for account: {name}',
testAccountTypeLabel: 'Account type: {type}', testAccountTypeLabel: 'Account type: {type}',
selectTestModel: 'Select Test Model', selectTestModel: 'Select Test Model',
testModel: 'claude-sonnet-4-5-20250929', testModel: 'Test model',
testPrompt: 'Prompt: "hi"', testPrompt: 'Prompt: "hi"',
// Stats Modal // Stats Modal
viewStats: 'View Stats', viewStats: 'View Stats',

View File

@@ -1041,17 +1041,19 @@ export default {
gemini: { gemini: {
title: 'Gemini 账户授权', title: 'Gemini 账户授权',
followSteps: '请按照以下步骤完成 Gemini 账户的授权:', followSteps: '请按照以下步骤完成 Gemini 账户的授权:',
step1GenerateUrl: '先配置 Redirect URI然后生成授权链接', step1GenerateUrl: '生成授权链接',
generateAuthUrl: '生成授权链接', generateAuthUrl: '生成授权链接',
projectIdLabel: 'Project ID可选',
projectIdPlaceholder: '例如my-gcp-project 或 cloud-ai-companion-xxxxx',
projectIdHint: '留空则在兑换授权码后自动探测;若自动探测失败,可填写后重新生成授权链接再授权。',
howToGetProjectId: '如何获取',
step2OpenUrl: '在浏览器中打开链接并完成授权', step2OpenUrl: '在浏览器中打开链接并完成授权',
openUrlDesc: '请在新标签页中打开授权链接,登录您的 Google 账户并授权。', openUrlDesc: '请在新标签页中打开授权链接,登录您的 Google 账户并授权。',
step3EnterCode: '输入回调链接或 Code', step3EnterCode: '输入回调链接或 Code',
authCodeDesc: authCodeDesc: '授权完成后,复制浏览器跳转后的回调链接(推荐)或仅复制 <code>code</code>,粘贴到下方即可。',
'授权完成后会跳转到 Redirect URI并带上 <code>code</code> 与 <code>state</code> 参数。请粘贴完整链接或仅粘贴 code',
authCode: '回调链接或 Code', authCode: '回调链接或 Code',
authCodePlaceholder: authCodePlaceholder: '方式1推荐粘贴回调链接\n方式2仅粘贴 code 参数的值',
'方式1粘贴完整回调链接\n(https://your-domain/auth/callback?code=...&state=...)\n方式2仅粘贴 code 参数的值', authCodeHint: '系统会自动从链接中解析 code/state。',
authCodeHint: '如果粘贴完整链接,系统会自动提取 code/state',
redirectUri: 'Redirect URI', redirectUri: 'Redirect URI',
redirectUriHint: '需要在 Google OAuth Client 中配置,且必须与此处完全一致。', redirectUriHint: '需要在 Google OAuth Client 中配置,且必须与此处完全一致。',
confirmRedirectUri: '我已在 Google OAuth Client 中配置了该 Redirect URI必须完全一致', confirmRedirectUri: '我已在 Google OAuth Client 中配置了该 Redirect URI必须完全一致',
@@ -1059,15 +1061,25 @@ export default {
redirectUriNotConfirmed: '请确认 Redirect URI 已在 Google OAuth Client 中正确配置', redirectUriNotConfirmed: '请确认 Redirect URI 已在 Google OAuth Client 中正确配置',
missingRedirectUri: '缺少 Redirect URI', missingRedirectUri: '缺少 Redirect URI',
failedToGenerateUrl: '生成 Gemini 授权链接失败', failedToGenerateUrl: '生成 Gemini 授权链接失败',
missingExchangeParams: '缺少 code / session_id / state / redirect_uri', missingExchangeParams: '缺少 code / session_id / state',
failedToExchangeCode: 'Gemini 授权码兑换失败', failedToExchangeCode: 'Gemini 授权码兑换失败',
modelPassthrough: 'Gemini 直接转发模型', modelPassthrough: 'Gemini 直接转发模型',
modelPassthroughDesc: '所有模型请求将直接转发至 Gemini API不进行模型限制或映射。', modelPassthroughDesc: '所有模型请求将直接转发至 Gemini API不进行模型限制或映射。',
stateWarningTitle: '⚠️ 重要Gemini 需要 code 和 state 参数', stateWarningTitle: '提示',
stateWarningDesc: stateWarningDesc: '建议粘贴完整回调链接(包含 code 和 state。',
'建议直接粘贴完整的回调链接,系统会自动提取 code 和 state。如果只粘贴 code授权将会失败。' oauthTypeLabel: 'OAuth 类型',
needsProjectId: '适合 GCP 开发者',
needsProjectIdDesc: '使用内置客户端,需 GCP 项目',
noProjectIdNeeded: '适合普通用户',
noProjectIdNeededDesc: '需自建 OAuth Client'
} }
}, },
// Gemini specific (platform-wide)
gemini: {
modelPassthrough: 'Gemini 直接转发模型',
modelPassthroughDesc: '所有模型请求将直接转发至 Gemini API不进行模型限制或映射。',
apiKeyHint: 'Your Gemini API Key以 AIza 开头)'
},
// Re-Auth Modal // Re-Auth Modal
reAuthorizeAccount: '重新授权账号', reAuthorizeAccount: '重新授权账号',
claudeCodeAccount: 'Claude Code 账号', claudeCodeAccount: 'Claude Code 账号',
@@ -1091,7 +1103,7 @@ export default {
startingTestForAccount: '开始测试账号:{name}', startingTestForAccount: '开始测试账号:{name}',
testAccountTypeLabel: '账号类型:{type}', testAccountTypeLabel: '账号类型:{type}',
selectTestModel: '选择测试模型', selectTestModel: '选择测试模型',
testModel: 'claude-sonnet-4-5-20250929', testModel: '测试模型',
testPrompt: '提示词:"hi"', testPrompt: '提示词:"hi"',
// Stats Modal // Stats Modal
viewStats: '查看统计', viewStats: '查看统计',