feat(frontend): 添加 Gemini OAuth 类型国际化
- zh.ts: 添加中文翻译(Code Assist/AI Studio 选择等) - en.ts: 添加英文翻译
This commit is contained in:
@@ -923,40 +923,55 @@ export default {
|
|||||||
'You can copy the entire URL or just the code parameter value, the system will auto-detect'
|
'You can copy the entire URL or just the code parameter value, the system will auto-detect'
|
||||||
},
|
},
|
||||||
// Gemini specific
|
// Gemini specific
|
||||||
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',
|
||||||
step2OpenUrl: 'Open the URL in your browser and complete authorization',
|
projectIdLabel: 'Project ID (optional)',
|
||||||
openUrlDesc:
|
projectIdPlaceholder: 'e.g. my-gcp-project or cloud-ai-companion-xxxxx',
|
||||||
'Open the authorization URL in a new tab, log in to your Google account and authorize.',
|
projectIdHint:
|
||||||
step3EnterCode: 'Enter Authorization URL or Code',
|
'Leave empty to auto-detect after code exchange. If auto-detection fails, fill it in and re-generate the auth URL to try again.',
|
||||||
authCodeDesc:
|
howToGetProjectId: 'How to get',
|
||||||
'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:',
|
step2OpenUrl: 'Open the URL in your browser and complete authorization',
|
||||||
authCode: 'Authorization URL or Code',
|
openUrlDesc:
|
||||||
authCodePlaceholder:
|
'Open the authorization URL in a new tab, log in to your Google account and authorize.',
|
||||||
'Option 1: Paste the complete callback URL\n(https://your-domain/auth/callback?code=...&state=...)\nOption 2: Paste only the code value',
|
step3EnterCode: 'Enter Authorization URL or Code',
|
||||||
authCodeHint:
|
authCodeDesc:
|
||||||
'If you paste the full URL, the system will auto-extract code/state for you',
|
'After authorization, copy the callback URL (recommended) or just the <code>code</code> and paste it below.',
|
||||||
|
authCode: 'Callback URL or Code',
|
||||||
|
authCodePlaceholder:
|
||||||
|
'Option 1 (recommended): Paste the callback URL\nOption 2: Paste only the code value',
|
||||||
|
authCodeHint: 'The system will auto-extract code/state from the URL.',
|
||||||
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.',
|
||||||
confirmRedirectUri:
|
confirmRedirectUri:
|
||||||
'I have configured this Redirect URI in the Google OAuth client (must match exactly)',
|
'I have configured this Redirect URI in the Google OAuth client (must match exactly)',
|
||||||
invalidRedirectUri: 'Redirect URI must be a valid http(s) URL',
|
invalidRedirectUri: 'Redirect URI must be a valid http(s) URL',
|
||||||
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',
|
||||||
@@ -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',
|
||||||
|
|||||||
@@ -1038,35 +1038,47 @@ export default {
|
|||||||
authCodeHint: '您可以直接复制整个链接或仅复制 code 参数值,系统会自动识别'
|
authCodeHint: '您可以直接复制整个链接或仅复制 code 参数值,系统会自动识别'
|
||||||
},
|
},
|
||||||
// Gemini specific
|
// Gemini specific
|
||||||
gemini: {
|
gemini: {
|
||||||
title: 'Gemini 账户授权',
|
title: 'Gemini 账户授权',
|
||||||
followSteps: '请按照以下步骤完成 Gemini 账户的授权:',
|
followSteps: '请按照以下步骤完成 Gemini 账户的授权:',
|
||||||
step1GenerateUrl: '先配置 Redirect URI,然后生成授权链接',
|
step1GenerateUrl: '生成授权链接',
|
||||||
generateAuthUrl: '生成授权链接',
|
generateAuthUrl: '生成授权链接',
|
||||||
step2OpenUrl: '在浏览器中打开链接并完成授权',
|
projectIdLabel: 'Project ID(可选)',
|
||||||
openUrlDesc: '请在新标签页中打开授权链接,登录您的 Google 账户并授权。',
|
projectIdPlaceholder: '例如:my-gcp-project 或 cloud-ai-companion-xxxxx',
|
||||||
step3EnterCode: '输入回调链接或 Code',
|
projectIdHint: '留空则在兑换授权码后自动探测;若自动探测失败,可填写后重新生成授权链接再授权。',
|
||||||
authCodeDesc:
|
howToGetProjectId: '如何获取',
|
||||||
'授权完成后会跳转到 Redirect URI,并带上 <code>code</code> 与 <code>state</code> 参数。请粘贴完整链接或仅粘贴 code:',
|
step2OpenUrl: '在浏览器中打开链接并完成授权',
|
||||||
authCode: '回调链接或 Code',
|
openUrlDesc: '请在新标签页中打开授权链接,登录您的 Google 账户并授权。',
|
||||||
authCodePlaceholder:
|
step3EnterCode: '输入回调链接或 Code',
|
||||||
'方式1:粘贴完整回调链接\n(https://your-domain/auth/callback?code=...&state=...)\n方式2:仅粘贴 code 参数的值',
|
authCodeDesc: '授权完成后,复制浏览器跳转后的回调链接(推荐)或仅复制 <code>code</code>,粘贴到下方即可。',
|
||||||
authCodeHint: '如果粘贴完整链接,系统会自动提取 code/state',
|
authCode: '回调链接或 Code',
|
||||||
|
authCodePlaceholder: '方式1(推荐):粘贴回调链接\n方式2:仅粘贴 code 参数的值',
|
||||||
|
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(必须完全一致)',
|
||||||
invalidRedirectUri: 'Redirect URI 必须是合法的 http(s) URL',
|
invalidRedirectUri: 'Redirect URI 必须是合法的 http(s) URL',
|
||||||
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: '重新授权账号',
|
||||||
@@ -1090,9 +1102,9 @@ export default {
|
|||||||
copyOutput: '复制输出',
|
copyOutput: '复制输出',
|
||||||
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: '查看统计',
|
||||||
usageStatistics: '使用统计',
|
usageStatistics: '使用统计',
|
||||||
|
|||||||
Reference in New Issue
Block a user