Skip to content

Conversation

archie-mckenzie
Copy link

Translated Stagehand docs into Chinese 🇨🇳

Almost all files in this PR are translated markdown files in the /zh route.

Outside of these new translation files:

  • Added gt.config.json which determines i18n settings. For example, whether /zh is prefixed to the page url in the default language.
  • Added a GitHub workflow file (.github/workflows/translate.yml) which will update translations on every commit to main.
  • Edited docs.json to include localized sidebars under navigation and redirects.

Next steps

Setting up continuous translation:

  • To enable continuous translation, add your project ID and an API key as GitHub variables. You can generate these on the Dashboard.
  • Then in GitHub, navigate to Settings > Security > Secrets and Variables > Actions under Repository Secrets. Add the new environment variables as GT_PROJECT_ID and GT_API_KEY.
  • After these are added, merge the PR, and everything will be set up.
image

Troubleshooting

Failing to execute action:

  • Make sure your action is enabled: In GitHub, under organization settings, navigate to Settings > Code, planning, and automation > Actions > General > Policies, and select Allow all actions and reusable workflows or add generaltranslation/translate@* to Allow enterprise, and select non-enterprise, actions and reusable workflows. Finally, click save.

Failing to create a PR:

  • Make sure your action has permissions: In GitHub, under organization settings, navigate to Settings > Code, planning, and automation > Actions > General > Workflow permissions (at the bottom), check Allow GitHub Actions to create and approve pull requests. Finally, click save.

Copy link

changeset-bot bot commented Aug 26, 2025

⚠️ No Changeset found

Latest commit: bc299d5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR adds comprehensive Chinese localization to the Stagehand documentation, creating a complete /zh route structure that mirrors the English documentation. The changes include:

Core Infrastructure:

  • Added gt.config.json configuration file for GeneralTranslation service with locale settings, experimental features, and URL pattern handling
  • Implemented .github/workflows/translate.yml GitHub workflow for automated translation on every commit to main
  • Updated docs.json to restructure navigation from a flat object to a languages array supporting both English (en) and Chinese (zh) locales
  • Added LOCADEX_MINTLIFY.md documentation explaining the internationalization setup

Translation Coverage:
The PR includes Chinese translations for the entire documentation structure (70+ files) covering:

  • Getting started guides (/zh/first-steps/)
  • Core functionality documentation (/zh/basics/ for act, extract, observe, agent)
  • Configuration guides (/zh/configuration/ for browser, models, logging, observability, evals)
  • Best practices (/zh/best-practices/ including caching, speed optimization, deployments, etc.)
  • Integration guides (/zh/integrations/ for Vercel, LangChain, CrewAI, MCP)
  • API references (/zh/references/)
  • Shared components (/zh/snippets/)

Translation Approach:
The translations maintain technical accuracy by preserving all code examples, API calls, and technical identifiers in English while translating explanatory text, comments, and user-facing content to Chinese. Internal navigation links are properly localized with /zh/ prefixes, while external links remain unchanged. The translations use appropriate Chinese technical terminology and follow standard documentation localization practices.

Automation Setup:
The GitHub workflow integrates with GeneralTranslation service to automatically create pull requests with updated Chinese translations whenever the main branch is updated. This requires GT_PROJECT_ID and GT_API_KEY secrets to be configured in the repository settings.

Confidence score: 4/5

  • This PR is generally safe to merge but requires careful setup of external dependencies
  • Score reflects the comprehensive nature of translations and proper i18n structure, but lowered due to external service dependencies and a few technical issues in translated files
  • Pay close attention to configuration files (gt.config.json), workflow permissions, and files with syntax errors in Python code comments

46 files reviewed, 23 comments

Edit Code Review Bot Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants