From 73b398071101d4fcd5f63635ee45297a0f40f2b3 Mon Sep 17 00:00:00 2001 From: mini Date: Tue, 21 Apr 2026 01:42:32 +0800 Subject: [PATCH] feat(portal): i18n-ify DocsView + auth narrative panels Extract all Chinese from DocsView.vue into docs.* namespace and add auth.narrative.* sub-namespace for LoginView/RegisterView narrative slots. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/i18n/locales/en.ts | 91 +++++++++++++++++++++++- frontend/src/i18n/locales/zh.ts | 89 +++++++++++++++++++++++ frontend/src/views/auth/LoginView.vue | 14 ++-- frontend/src/views/auth/RegisterView.vue | 22 +++--- frontend/src/views/docs/DocsView.vue | 75 +++++++++---------- 5 files changed, 238 insertions(+), 53 deletions(-) diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index a3008136..507c1882 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -499,7 +499,39 @@ export default { invalidResetLink: 'Invalid Reset Link', invalidResetLinkHint: 'This password reset link is invalid or has expired. Please request a new one.', requestNewResetLink: 'Request New Reset Link', - invalidOrExpiredToken: 'The password reset link is invalid or has expired. Please request a new one.' + invalidOrExpiredToken: 'The password reset link is invalid or has expired. Please request a new one.', + narrative: { + common: { + statusLive: 'live', + }, + login: { + kicker: '// you already paid for your subscriptions', + headlineN: 'N', + headlineOne: '1', + headlineSep: 'subscriptions →', + headlineSuffix: 'key', + sub1: 'No more juggling accounts,', + sub2: 'no more paying twice for overlapping subscriptions.', + tagline: 'PURO — AI calls, back to basics.', + }, + register: { + kicker: '// up and running in 5 minutes', + headlineN: 'N', + headlineOne: '1', + headlineSep: 'subscriptions →', + headlineSuffix: 'key', + sub1: 'No more juggling accounts,', + sub2: 'no more paying twice for overlapping subscriptions.', + tagline: 'PURO — AI calls, back to basics.', + stepsTitle: '// next steps', + step1Title: 'Create account', + step1Desc: 'Email + password, or LinuxDO OAuth', + step2Title: 'Connect subscription', + step2Desc: 'OAuth into your existing Claude Pro / ChatGPT Plus', + step3Title: 'Get your API key', + step3Desc: 'Grab your sk-puro-… and swap the SDK\'s base_url', + }, + }, }, // Dashboard @@ -5680,4 +5712,61 @@ export default { }, }, + docs: { + nav: { + products: 'Product', + pricing: 'Pricing', + docs: 'Docs', + login: 'Sign in', + signup: 'Sign up', + }, + hero: { + title: 'Quickstart — PURO AI', + subtitle: 'Three steps: get a key → set base_url → send a request', + }, + sections: { + getKey: { + heading: '1. Get your API key', + desc: 'PURO AI is currently invite-only. Contact the admin to get access:', + note: 'Subscription self-purchase via the iShare portal is coming soon.', + }, + codex: { + heading: '2. Codex CLI setup', + configIntro: 'Edit ~/.codex/config.toml:', + authIntro: 'Then ~/.codex/auth.json:', + verifyIntro: 'Verify:', + copy: 'Copy', + copied: 'Copied', + }, + claudeCode: { + heading: '3. Claude Code setup', + configIntro: 'Edit ~/.claude/settings.json:', + note: 'Claude Code calls the Anthropic-compatible API via the /v1/messages endpoint.', + copy: 'Copy', + copied: 'Copied', + }, + curl: { + heading: '4. curl quick test', + openaiIntro: 'OpenAI Responses API:', + anthropicIntro: 'Anthropic Messages API:', + copy: 'Copy', + copied: 'Copied', + }, + models: { + heading: '5. Available models', + colModel: 'Model', + colPlatform: 'Platform / source', + colContext: 'Context', + colStatus: 'Status', + codexDedicated: 'OpenAI Codex dedicated', + note: 'Pricing is tracked live from model-price-repo. Full list available in the dashboard after signing in.', + noteConsole: 'dashboard', + }, + feedback: { + heading: '6. Feedback', + desc: 'Run into an issue or want a new platform added:', + }, + }, + }, + } diff --git a/frontend/src/i18n/locales/zh.ts b/frontend/src/i18n/locales/zh.ts index 43168bd0..13e192ec 100644 --- a/frontend/src/i18n/locales/zh.ts +++ b/frontend/src/i18n/locales/zh.ts @@ -505,6 +505,38 @@ export default { puroRegisterTitle: '创建账户', puroRegisterSub: '5 分钟开始用 PURO AI', confirmPasswordLabel: '确认密码', + narrative: { + common: { + statusLive: 'live', + }, + login: { + kicker: '// 你的订阅,已经付过钱了', + headlineN: 'N', + headlineOne: '1', + headlineSep: '个订阅 →', + headlineSuffix: '个 key', + sub1: '省去切换账号的繁琐,', + sub2: '省去为多个高昂订阅重复买单。', + tagline: 'PURO(纯粹)—— 让 AI 调用回归本质。', + }, + register: { + kicker: '// 5 分钟开始用', + headlineN: 'N', + headlineOne: '1', + headlineSep: '个订阅 →', + headlineSuffix: '个 key', + sub1: '省去切换账号的繁琐,', + sub2: '省去为多个高昂订阅重复买单。', + tagline: 'PURO(纯粹)—— 让 AI 调用回归本质。', + stepsTitle: '// 下一步', + step1Title: '创建账户', + step1Desc: '邮箱 + 密码,或用 LinuxDO OAuth', + step2Title: '绑定订阅', + step2Desc: 'OAuth 接入你现有的 Claude Pro / ChatGPT Plus', + step3Title: '生成 key', + step3Desc: '拿到 sk-puro-…,换掉 SDK 的 base_url', + }, + }, }, // Dashboard @@ -5873,4 +5905,61 @@ export default { }, }, + docs: { + nav: { + products: '产品', + pricing: '定价', + docs: '文档', + login: '登录', + signup: '注册', + }, + hero: { + title: '快速接入 PURO AI', + subtitle: '三步走:拿 key → 配 base_url → 发请求', + }, + sections: { + getKey: { + heading: '1. 获取 API key', + desc: '当前 PURO AI 不开放自助注册付费。联系管理员获取:', + note: '未来通过 iShare 入口开放订阅购买。', + }, + codex: { + heading: '2. Codex CLI 接入', + configIntro: '修改 ~/.codex/config.toml:', + authIntro: '然后 ~/.codex/auth.json:', + verifyIntro: '验证:', + copy: '复制', + copied: '已复制', + }, + claudeCode: { + heading: '3. Claude Code 接入', + configIntro: '修改 ~/.claude/settings.json:', + note: 'Claude Code 通过 /v1/messages endpoint 调用 Anthropic 兼容 API。', + copy: '复制', + copied: '已复制', + }, + curl: { + heading: '4. curl 直连测试', + openaiIntro: 'OpenAI Responses API:', + anthropicIntro: 'Anthropic Messages API:', + copy: '复制', + copied: '已复制', + }, + models: { + heading: '5. 支持的模型', + colModel: '模型', + colPlatform: '平台 / 来源', + colContext: '上下文', + colStatus: '状态', + codexDedicated: 'OpenAI Codex 专用', + note: '后端 pricing 表实时跟进 model-price-repo,完整清单登录后在控制台查看。', + noteConsole: '控制台', + }, + feedback: { + heading: '6. 问题反馈', + desc: '遇到问题或希望补接某个平台:', + }, + }, + }, + } diff --git a/frontend/src/views/auth/LoginView.vue b/frontend/src/views/auth/LoginView.vue index 4f876e03..d38681a3 100644 --- a/frontend/src/views/auth/LoginView.vue +++ b/frontend/src/views/auth/LoginView.vue @@ -11,15 +11,17 @@
-
// 你的订阅,已经付过钱了
+
{{ t('auth.narrative.login.kicker') }}
- N 个订阅
- → 1 个 key + {{ t('auth.narrative.login.headlineN') }} + {{ ' ' + t('auth.narrative.login.headlineSep') + ' ' }} + {{ t('auth.narrative.login.headlineOne') }} + {{ ' ' + t('auth.narrative.login.headlineSuffix') }}

- 省去切换账号的繁琐,
- 省去为多个高昂订阅重复买单。
- PURO(纯粹)—— 让 AI 调用回归本质。 + {{ t('auth.narrative.login.sub1') }}
+ {{ t('auth.narrative.login.sub2') }}
+ {{ t('auth.narrative.login.tagline') }}

diff --git a/frontend/src/views/auth/RegisterView.vue b/frontend/src/views/auth/RegisterView.vue index da1e1bab..0008f035 100644 --- a/frontend/src/views/auth/RegisterView.vue +++ b/frontend/src/views/auth/RegisterView.vue @@ -11,31 +11,33 @@
-
// 5 分钟开始用
+
{{ t('auth.narrative.register.kicker') }}
- N 个订阅
- → 1 个 key + {{ t('auth.narrative.register.headlineN') }} + {{ ' ' + t('auth.narrative.register.headlineSep') + ' ' }} + {{ t('auth.narrative.register.headlineOne') }} + {{ ' ' + t('auth.narrative.register.headlineSuffix') }}

- 省去切换账号的繁琐,
- 省去为多个高昂订阅重复买单。
- PURO(纯粹)—— 让 AI 调用回归本质。 + {{ t('auth.narrative.register.sub1') }}
+ {{ t('auth.narrative.register.sub2') }}
+ {{ t('auth.narrative.register.tagline') }}

-
// 下一步
+
{{ t('auth.narrative.register.stepsTitle') }}
1
-
创建账户 · 邮箱 + 密码,或用 LinuxDO OAuth
+
{{ t('auth.narrative.register.step1Title') }} · {{ t('auth.narrative.register.step1Desc') }}
2
-
绑定订阅 · OAuth 接入你现有的 Claude Pro / ChatGPT Plus
+
{{ t('auth.narrative.register.step2Title') }} · {{ t('auth.narrative.register.step2Desc') }}
3
-
生成 key · 拿到 sk-puro-…,换掉 SDK 的 base_url
+
{{ t('auth.narrative.register.step3Title') }} · {{ t('auth.narrative.register.step3Desc') }}
diff --git a/frontend/src/views/docs/DocsView.vue b/frontend/src/views/docs/DocsView.vue index f4cc92a7..01eb1363 100644 --- a/frontend/src/views/docs/DocsView.vue +++ b/frontend/src/views/docs/DocsView.vue @@ -11,36 +11,36 @@ PURO AI
-

快速接入 PURO AI

-

三步走:拿 key → 配 base_url → 发请求

+

{{ $t('docs.hero.title') }}

+

{{ $t('docs.hero.subtitle') }}

-

1. 获取 API key

-

当前 PURO AI 不开放自助注册付费。联系管理员获取:

+

{{ $t('docs.sections.getKey.heading') }}

+

{{ $t('docs.sections.getKey.desc') }}

-

未来通过 iShare 入口开放订阅购买。

+

{{ $t('docs.sections.getKey.note') }}

-

2. Codex CLI 接入

-

修改 ~/.codex/config.toml

+

{{ $t('docs.sections.codex.heading') }}

+

{{ $t('docs.sections.codex.configIntro') }}

@@ -54,7 +54,7 @@ - 复制 + {{ $t('docs.sections.codex.copy') }}
model_provider = "OpenAI"
@@ -67,7 +67,7 @@ base_url = "https://ai.puro.im"
 wire_api = "responses"
 requires_openai_auth = true
-

然后 ~/.codex/auth.json

+

{{ $t('docs.sections.codex.authIntro') }}

@@ -81,14 +81,14 @@ requires_openai_auth = true - 复制 + {{ $t('docs.sections.codex.copy') }}
{
   "OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxx"
 }
-

验证:

+

{{ $t('docs.sections.codex.verifyIntro') }}

@@ -102,7 +102,7 @@ requires_openai_auth = true - 复制 + {{ $t('docs.sections.codex.copy') }}
$ codex exec --sandbox read-only "say hi"
@@ -110,8 +110,8 @@ requires_openai_auth = true
-

3. Claude Code 接入

-

修改 ~/.claude/settings.json

+

{{ $t('docs.sections.claudeCode.heading') }}

+

{{ $t('docs.sections.claudeCode.configIntro') }}

@@ -125,7 +125,7 @@ requires_openai_auth = true - 复制 + {{ $t('docs.sections.claudeCode.copy') }}
{
@@ -133,12 +133,12 @@ requires_openai_auth = true
"api_key": "sk-xxxxxxxxxxxxxxxx" }
-

Claude Code 通过 /v1/messages endpoint 调用 Anthropic 兼容 API。

+

{{ $t('docs.sections.claudeCode.note') }}

-

4. curl 直连测试

-

OpenAI Responses API:

+

{{ $t('docs.sections.curl.heading') }}

+

{{ $t('docs.sections.curl.openaiIntro') }}

@@ -152,7 +152,7 @@ requires_openai_auth = true - 复制 + {{ $t('docs.sections.curl.copy') }}
$ curl https://ai.puro.im/responses \
@@ -160,7 +160,7 @@ requires_openai_auth = true
-H "Content-Type: application/json" \ -d '{"model":"gpt-5.4","input":"hello"}'
-

Anthropic Messages API:

+

{{ $t('docs.sections.curl.anthropicIntro') }}

@@ -174,7 +174,7 @@ requires_openai_auth = true - 复制 + {{ $t('docs.sections.curl.copy') }}
$ curl https://ai.puro.im/v1/messages \
@@ -186,15 +186,15 @@ requires_openai_auth = true
-

5. 支持的模型

+

{{ $t('docs.sections.models.heading') }}

- - - - + + + + @@ -206,7 +206,7 @@ requires_openai_auth = true - + @@ -237,12 +237,12 @@ requires_openai_auth = true
模型平台 / 来源上下文状态{{ $t('docs.sections.models.colModel') }}{{ $t('docs.sections.models.colPlatform') }}{{ $t('docs.sections.models.colContext') }}{{ $t('docs.sections.models.colStatus') }}
gpt-5.4-codexOpenAI Codex 专用{{ $t('docs.sections.models.codexDedicated') }} 272K OK
-

后端 pricing 表实时跟进 model-price-repo,完整清单登录后在 控制台 查看。

+

{{ $t('docs.sections.models.note') }}

-

6. 问题反馈

-

遇到问题或希望补接某个平台:

+

{{ $t('docs.sections.feedback.heading') }}

+

{{ $t('docs.sections.feedback.desc') }}

@@ -252,8 +252,11 @@ requires_openai_auth = true