openai / openai/openai-agents-python

Generated translated docs (ja/ko/zh) contain ~30 broken relative links (translate_docs.py copies English link targets verbatim)

Open
#5,092 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
29.6k
Forks
4.8k
Avg merge
1d 20h
Merged PRs (30d)
123

Description

Summary

The generated translated docs under docs/ja, docs/ko, and docs/zh contain ~30 broken relative links, because docs/scripts/translate_docs.py copies the English pages' link targets verbatim. English pages live directly under docs/, so a link like ref/lifecycle.md resolves correctly there — but from the locale subdirectories (docs/ja/, docs/ko/, docs/zh/) the same target resolves to docs/<locale>/ref/..., which does not exist.

I have not edited the translated files, since AGENTS.md states they are generated and must not be hand-edited — so this report suggests the fix belongs in the translation script (which already rewrites heading anchors for the same reason, via refresh_heading_anchors).

Broken link patterns (each × ja/ko/zh)
  • docs/{ja,ko,zh}/agents.mdref/lifecycle.md (needs ../ref/lifecycle.md)
  • docs/{ja,ko,zh}/mcp.mdref/mcp/manager.md
  • docs/{ja,ko,zh}/sessions.mdref/memory/openai_conversations_session.md
  • docs/{ja,ko,zh}/testing.mdref/testing.md, ref/realtime/testing.md, ref/voice/testing.md
  • docs/{ja,ko,zh}/tools.mdref/extensions/experimental/codex/codex_tool.md, ref/extensions/experimental/codex/thread_options.md, ref/extensions/experimental/codex/turn_options.md
  • docs/{ja,ko,zh}/sandbox/guide.md../assets/images/harness_with_compute.png (needs ../../assets/..., one level deeper because sandbox/ is itself nested)

All 30 corrected targets were verified to exist on disk at commit fdf21db62c303a3db54b0dfbee82de2141fa2799. mkdocs.yml includes all three locales as alternates, so these links also break on the rendered site.

Suggested fix

In translate_docs.py, when emitting a translated page, rewrite relative link targets the same way heading anchors are handled: resolve the target against the English source file's directory, then re-relativize against the locale file's directory (e.g. prefix an extra ../). A follow-up regeneration via make build-full-docs would then repair the generated files.


Disclosure: this issue was prepared with AI assistance (mechanical link audit + local verification, operated by @yetuge).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in docs/scripts/translate_docs.py, especially the link handling near refresh_heading_anchors, and review AGENTS.md for generated-file rules. Update translation output so relative targets are resolved from the English source and re-relativized for locale pages, then run make build-full-docs and verify the listed links in docs/ja, docs/ko, and docs/zh resolve correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, localization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.