frontend: normalize auth oauth i18n and error toasts

This commit is contained in:
IanShaw027
2026-04-21 22:26:11 +08:00
parent 4c21320d1b
commit a6b919eb53
25 changed files with 909 additions and 472 deletions

View File

@@ -309,6 +309,7 @@ export default {
view: 'View',
settings: 'Settings',
chooseFile: 'Choose File',
copy: 'Copy',
notAvailable: 'N/A',
now: 'Now',
today: 'Today',
@@ -407,6 +408,7 @@ export default {
verificationCode: 'Verification Code',
verificationCodeHint: 'Enter the 6-digit code sent to your email',
sendingCode: 'Sending...',
sendCode: 'Send code',
clickToResend: 'Click to resend code',
resendCode: 'Resend verification code',
sendCodeDesc: "We'll send a verification code to",
@@ -466,7 +468,51 @@ export default {
completing: 'Completing registration…',
completeRegistrationFailed: 'Registration failed. Please check your invitation code and try again.'
},
oauthFlow: {
profileDetailsTitle: 'Use {providerName} profile details',
profileDetailsDescription: 'Choose whether to apply the nickname or avatar from {providerName} to this account.',
useDisplayName: 'Use display name',
useAvatar: 'Use avatar',
avatarAlt: '{providerName} avatar',
reviewProfileBeforeContinue: 'Review the {providerName} profile details before continuing.',
chooseHowToContinue: 'Choose how to continue',
chooseAccountActionHint: 'Choose whether to bind an existing account or create a new one.',
suggestedEmail: 'Suggested email: {email}',
bindExistingAccount: 'Bind existing account',
createNewAccount: 'Create new account',
createAccountHint: 'Enter an email address to create your account and continue.',
bindLoginHint: 'Log in to an existing account to bind this {providerName} sign-in.',
signInThenBindDescription: 'Sign in to an existing account, then bind this {providerName} sign-in to it.',
bindSignInToExistingAccount: 'Bind this {providerName} sign-in to an existing account.',
bindCurrentAccountTitle: 'Bind the current account',
bindCurrentAccountDescription: 'Bind this {providerName} sign-in to the account currently signed in on this browser.',
bindCurrentAccount: 'Bind current account',
logInAndBind: 'Log in and bind',
useDifferentEmail: 'Use a different email',
backToOptions: 'Back to options',
yourAccount: 'your account',
totpHint: 'Enter the 6-digit verification code for {account} to finish binding this {providerName} sign-in.',
verifyAndContinue: 'Verify and continue',
wechatAvailabilityUnknown: 'WeChat sign-in availability could not be confirmed. Refresh and retry.',
wechatSystemBrowserOnly: 'This WeChat sign-in flow is only available in your system browser.',
wechatBrowserOnly: 'This WeChat sign-in flow is only available inside the WeChat browser.',
wechatNotConfigured: 'WeChat sign-in is not configured yet.'
},
linuxdoCallbackPageTitle: 'LinuxDo Sign-In Callback',
oidcCallbackPageTitle: 'OIDC Sign-In Callback',
oauthCallbackPageTitle: 'OAuth Callback',
wechatProviderName: 'WeChat',
wechatCallbackPageTitle: 'WeChat Sign-In Callback',
wechatPaymentCallbackPageTitle: 'WeChat Payment Callback',
wechatPayment: {
callbackTitle: 'Resuming WeChat payment',
callbackProcessing: 'Resuming WeChat payment...',
backToPayment: 'Back to payment',
callbackMissingResumeToken: 'The WeChat payment callback is missing the resume token.'
},
oauth: {
callbackTitle: 'OAuth Callback',
callbackHint: 'Copy the code and state back to the admin authorization flow when needed.',
code: 'Code',
state: 'State',
fullUrl: 'Full URL'
@@ -1425,6 +1471,7 @@ export default {
updating: 'Updating...',
columns: {
user: 'User',
id: 'ID',
email: 'Email',
username: 'Username',
notes: 'Notes',
@@ -4972,6 +5019,72 @@ export default {
presetOpusOnlyDesc: 'Pass for Opus, filter others',
commonPatterns: 'Common patterns'
},
wechatConnect: {
title: 'WeChat Connect',
description: 'Third-party login configuration for WeChat Open Platform or Official Account / Mini Program.',
enabledLabel: 'Enable WeChat Connect',
enabledHint: 'Enable this to configure WeChat OAuth callbacks and authorization.',
appIdLabel: 'App ID',
appIdPlaceholder: 'WeChat App ID',
appSecretLabel: 'App Secret',
appSecretConfiguredPlaceholder: 'Secret configured. Leave empty to keep the current value.',
appSecretPlaceholder: 'WeChat App Secret',
appSecretConfiguredHint: 'Secret configured. Leave empty to keep the current value.',
appSecretHint: 'Enter a new secret to replace the current WeChat credential.',
modeLabel: 'Mode',
openModeLabel: 'Use Open outside WeChat',
openModeHint: 'Use Open Platform QR authorization outside the WeChat browser.',
mpModeLabel: 'Use MP inside WeChat',
mpModeHint: 'Use Official Account authorization inside the WeChat browser.',
redirectUrlLabel: 'Redirect URL',
redirectUrlPlaceholder: 'https://your-site.com/api/v1/auth/oauth/wechat/callback',
generateAndCopy: 'Generate & Copy (current site)',
redirectUrlSetAndCopied: 'Redirect URL generated and copied to clipboard',
frontendRedirectUrlLabel: 'Frontend redirect URL',
frontendRedirectUrlPlaceholder: '/auth/wechat/callback',
frontendRedirectUrlHint: 'Usually the frontend route callback path; keep it aligned with the backend.'
},
authSourceDefaults: {
title: 'Auth Source Defaults',
description: 'Configure per-source default balance, concurrency, subscriptions, and grant rules.',
requireEmailLabel: 'Require email on third-party signup',
requireEmailHint: 'When enabled, Linux DO, OIDC, and WeChat signups must provide an email before account creation.',
enabledHint: 'These defaults apply when a new user registers through this source. Grant on first bind only applies when an existing user binds this source.',
sources: {
email: {
title: 'Email signup',
description: 'Default quota grants for email-password signups.'
},
linuxdo: {
title: 'Linux DO signup',
description: 'Default quota grants for Linux DO signups.'
},
oidc: {
title: 'OIDC signup',
description: 'Default quota grants for OIDC signups.'
},
wechat: {
title: 'WeChat signup',
description: 'Default quota grants for WeChat signups.'
}
},
grantOnFirstBindLabel: 'Grant on first bind',
grantOnFirstBindHint: 'Grant default entitlements when an existing user first binds this source.',
defaultSubscriptionsLabel: 'Default subscriptions',
defaultSubscriptionsHint: 'Applies only to this auth source. Leave empty to skip source-specific subscriptions.',
noSourceSubscriptions: 'No source-specific default subscriptions configured.'
},
paymentVisibleMethods: {
methodLabel: '{title} visible method',
methodHint: 'Controls whether checkout shows this method and which source key it exposes.',
sourceLabel: 'Payment source',
sourceHint: 'Choose an explicit source before enabling the method. Not configured methods are not exposed.',
sourceRequiredError: 'Select a payment source before enabling {title}.'
},
openaiExperimentalScheduler: {
title: 'OpenAI experimental scheduler policy',
description: "Disabled by default. When enabled, this only changes the gateway's experimental account-selection policy for OpenAI traffic; it does not indicate an upstream OpenAI capability."
},
saveSettings: 'Save Settings',
saving: 'Saving...',
settingsSaved: 'Settings saved successfully',
@@ -5461,6 +5574,7 @@ export default {
viewOrders: 'View Orders',
},
currentBalance: 'Current Balance',
groupFallback: 'Group #{id}',
rechargeAccount: 'Recharge Account',
activeSubscription: 'Active Subscription',
noActiveSubscription: 'No active subscription',

View File

@@ -309,6 +309,7 @@ export default {
view: '查看',
settings: '设置',
chooseFile: '选择文件',
copy: '复制',
notAvailable: '不可用',
now: '现在',
today: '今天',
@@ -406,6 +407,7 @@ export default {
verificationCode: '验证码',
verificationCodeHint: '请输入发送到您邮箱的6位验证码',
sendingCode: '发送中...',
sendCode: '发送验证码',
clickToResend: '点击重新发送验证码',
resendCode: '重新发送验证码',
sendCodeDesc: '我们将发送验证码到',
@@ -464,7 +466,51 @@ export default {
completing: '正在完成注册...',
completeRegistrationFailed: '注册失败,请检查邀请码后重试。'
},
oauthFlow: {
profileDetailsTitle: '使用 {providerName} 资料',
profileDetailsDescription: '选择是否将 {providerName} 的昵称或头像应用到当前账户。',
useDisplayName: '使用昵称',
useAvatar: '使用头像',
avatarAlt: '{providerName} 头像',
reviewProfileBeforeContinue: '请先确认 {providerName} 资料后再继续。',
chooseHowToContinue: '选择后续操作',
chooseAccountActionHint: '请选择绑定已有账户,或创建一个新账户。',
suggestedEmail: '建议邮箱:{email}',
bindExistingAccount: '绑定已有账户',
createNewAccount: '创建新账户',
createAccountHint: '请输入邮箱地址以创建账户并继续。',
bindLoginHint: '登录一个已有账户以绑定此次 {providerName} 登录。',
signInThenBindDescription: '请先登录已有账户,再将此次 {providerName} 登录绑定到该账户。',
bindSignInToExistingAccount: '将此次 {providerName} 登录绑定到已有账户。',
bindCurrentAccountTitle: '绑定当前账户',
bindCurrentAccountDescription: '将此次 {providerName} 登录绑定到当前浏览器已登录的账户。',
bindCurrentAccount: '绑定当前账户',
logInAndBind: '登录并绑定',
useDifferentEmail: '使用其他邮箱',
backToOptions: '返回选项',
yourAccount: '当前账户',
totpHint: '请输入 {account} 的 6 位验证码,以完成此次 {providerName} 登录绑定。',
verifyAndContinue: '验证并继续',
wechatAvailabilityUnknown: '暂时无法确认微信登录可用性,请刷新后重试。',
wechatSystemBrowserOnly: '当前微信登录流程仅支持在系统浏览器中继续。',
wechatBrowserOnly: '当前微信登录流程仅支持在微信内置浏览器中继续。',
wechatNotConfigured: '微信登录尚未配置。'
},
linuxdoCallbackPageTitle: 'LinuxDo 登录回调',
oidcCallbackPageTitle: 'OIDC 登录回调',
oauthCallbackPageTitle: 'OAuth 回调',
wechatProviderName: '微信',
wechatCallbackPageTitle: '微信登录回调',
wechatPaymentCallbackPageTitle: '微信支付回调',
wechatPayment: {
callbackTitle: '正在恢复微信支付',
callbackProcessing: '正在恢复微信支付...',
backToPayment: '返回支付页',
callbackMissingResumeToken: '微信支付回调缺少恢复令牌。'
},
oauth: {
callbackTitle: 'OAuth 回调',
callbackHint: '按需将授权码和状态值复制回后台授权流程。',
code: '授权码',
state: '状态',
fullUrl: '完整URL'
@@ -1451,6 +1497,7 @@ export default {
updating: '更新中...',
columns: {
user: '用户',
id: 'ID',
email: '邮箱',
username: '用户名',
notes: '备注',
@@ -5135,6 +5182,72 @@ export default {
presetOpusOnlyDesc: 'Opus 透传,其他模型过滤',
commonPatterns: '常用模式'
},
wechatConnect: {
title: '微信登录',
description: '用于微信开放平台或公众号/小程序的第三方登录配置。',
enabledLabel: '启用微信登录',
enabledHint: '开启后可使用微信第三方登录回调与授权配置。',
appIdLabel: 'AppID',
appIdPlaceholder: '微信开放平台 AppID',
appSecretLabel: 'AppSecret',
appSecretConfiguredPlaceholder: '密钥已配置,留空以保留当前值。',
appSecretPlaceholder: '微信开放平台 AppSecret',
appSecretConfiguredHint: '密钥已配置,留空以保留当前值。',
appSecretHint: '填写后会覆盖当前微信密钥。',
modeLabel: '模式',
openModeLabel: '非微信环境使用开放平台',
openModeHint: '浏览器不在微信内时,自动走开放平台扫码授权。',
mpModeLabel: '微信环境使用公众号',
mpModeHint: '浏览器在微信内时,自动走公众号授权。',
redirectUrlLabel: '回调地址',
redirectUrlPlaceholder: 'https://your-site.com/api/v1/auth/oauth/wechat/callback',
generateAndCopy: '使用当前站点生成并复制',
redirectUrlSetAndCopied: '已使用当前站点生成回调地址并复制到剪贴板',
frontendRedirectUrlLabel: '前端回调地址',
frontendRedirectUrlPlaceholder: '/auth/wechat/callback',
frontendRedirectUrlHint: '通常用于前端路由回调地址,需与后端配置保持一致。'
},
authSourceDefaults: {
title: '认证来源默认值',
description: '按注册来源配置新用户默认余额、并发、订阅与授权策略。',
requireEmailLabel: '第三方注册强制补充邮箱',
requireEmailHint: '启用后Linux DO、OIDC、微信注册缺少邮箱时必须先补充邮箱地址。',
enabledHint: '以下默认值会在该来源注册新用户时发放;首次绑定时授权仅作用于已有账号绑定该来源。',
sources: {
email: {
title: '邮箱注册',
description: '适用于邮箱密码注册的新用户默认配额。'
},
linuxdo: {
title: 'Linux DO 登录',
description: '适用于 Linux DO 第三方注册的新用户默认配额。'
},
oidc: {
title: 'OIDC 登录',
description: '适用于 OIDC 第三方注册的新用户默认配额。'
},
wechat: {
title: '微信登录',
description: '适用于微信第三方注册的新用户默认配额。'
}
},
grantOnFirstBindLabel: '首次绑定时授权',
grantOnFirstBindHint: '已有账号首次绑定该来源时发放默认权益。',
defaultSubscriptionsLabel: '默认订阅',
defaultSubscriptionsHint: '仅对当前认证来源生效,未配置时不追加来源专属订阅。',
noSourceSubscriptions: '当前来源未配置专属默认订阅。'
},
paymentVisibleMethods: {
methodLabel: '{title} 可见方式',
methodHint: '控制前台结算页是否展示该方式,以及展示时使用的来源键。',
sourceLabel: '支付来源',
sourceHint: '启用后必须明确选择一个来源;未配置状态不会对外展示该支付方式。',
sourceRequiredError: '{title} 已启用,请先选择支付来源。'
},
openaiExperimentalScheduler: {
title: 'OpenAI 实验调度策略',
description: '默认关闭。开启后仅影响本网关在 OpenAI 账号间的实验性调度选择逻辑,不代表上游 OpenAI 官方能力。'
},
saveSettings: '保存设置',
saving: '保存中...',
settingsSaved: '设置保存成功',
@@ -5649,6 +5762,7 @@ export default {
viewOrders: '查看订单',
},
currentBalance: '当前余额',
groupFallback: '分组 #{id}',
rechargeAccount: '充值账户',
activeSubscription: '当前订阅',
noActiveSubscription: '暂无有效订阅',