Skip to content

feat: add language-aware ChatGPT translation parameters#22084

Open
ZainKazmiii wants to merge 3 commits into
DIYgod:masterfrom
ZainKazmiii:fix/6696-feed-translate-params-20260523-v2
Open

feat: add language-aware ChatGPT translation parameters#22084
ZainKazmiii wants to merge 3 commits into
DIYgod:masterfrom
ZainKazmiii:fix/6696-feed-translate-params-20260523-v2

Conversation

@ZainKazmiii

@ZainKazmiii ZainKazmiii commented May 23, 2026

Copy link
Copy Markdown

Involved Issue / 该 PR 相关 Issue

Close #6696
/claim #6696

Example for the Proposed Route(s) / 路由地址示例

NOROUTE

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

Summary

  • add optional chatgpt_to (alias chatgpt_lang) and chatgpt_from query parameters in the global parameter middleware
  • when language overrides are provided, ChatGPT prompt generation translates title/content toward the requested target language
  • include language pair in OpenAI cache keys when a target language is requested, while source-only requests keep the default cache key
  • add focused tests for target-language override and source-only cache behavior
  • fix import ordering in lib/middleware/parameter.test.ts to satisfy project lint rules

Validation

  • pnpm install --frozen-lockfile --ignore-scripts
  • npx -y node@24 node_modules/tsx/dist/cli.mjs scripts/workflow/build-routes.ts
  • NODE_ENV=test npx -y node@24 node_modules/vitest/vitest.mjs lib/middleware/parameter.test.ts (49 passed)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 21258f9537

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/middleware/parameter.ts Outdated
@ZainKazmiii ZainKazmiii force-pushed the fix/6696-feed-translate-params-20260523-v2 branch from 1316200 to 3732c40 Compare May 25, 2026 09:46
@ZainKazmiii

Copy link
Copy Markdown
Author

Quick follow-up on this bounty PR for #6696.

I confirmed the branch is current with upstream master and there are no failed or pending checks on the PR head from my side. If you want any naming or test adjustments before merge, I can update quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

增加Feed翻译功能

2 participants