This repository contains an automatically maintained Simplified Chinese Markdown mirror of the reader-facing documentation in fmhy/edit. The translation worker is a Go command run by GitHub Actions. It keeps the source Markdown structure, links, code, commands, and FMHY-specific admonitions intact while sending only prose units to a configurable OpenAI-compatible API.
The generated files are written under docs/ using the same relative paths as the upstream docs/ tree. This repository intentionally does not translate the VitePress application code or configure a website; point your own VitePress site at the generated Markdown when you are ready.
- Create a repository from this project and enable Actions read/write permission under Settings → Actions → General.
- Add an Actions secret named
LLM_API_KEY. - Optionally add repository variables
LLM_API_BASE_URL,LLM_API_ENDPOINT,LLM_MODEL, andLLM_RESPONSE_MODE. The defaults are the OpenAI API, its/chat/completionsendpoint,gpt-4o-mini, andjson_schema;json_objectis useful for providers that do not implement JSON Schema response formatting, andplainomits the provider hint while still requiring valid JSON.LLM_RETRY_INITIAL_DELAY_SECONDS,LLM_RETRY_MAX_DELAY_SECONDS,LLM_REQUEST_TIMEOUT_SECONDS(0disables the client-side timeout),LLM_MAX_BATCH_CHARS, andLLM_CONCURRENCYoverride the correspondingtranslation.jsonfields without a commit. - Review
translation.jsonand adjust the provider, model, glossary, request limits, or retry intervals. Each request retries without limit on transport errors, HTTP 408/429/5xx, and truncated provider payloads, with exponential backoff beginning at 15 seconds and capped at 10 minutes; aRetry-Afterresponse header is honored within that cap.request_timeout_seconds: 0(the default) disables the client-side timeout so slow responses are never cut off, and the workflow reruns the whole sync on transient failures until it succeeds. The API key is never read from that file. - Run “Sync Simplified Chinese FMHY docs” manually with
forceenabled for the first full import. Later scheduled runs check daily and perform work only after 144 hours have elapsed since the last successful sync.
The workflow checks upstream main at a fixed commit, translates new or changed Markdown units, validates the reconstructed documents, and commits docs/ plus .translation-state/state.json back to the current branch. A failed run leaves the previously committed translation untouched. GitHub’s scheduler is best effort, so the daily check and persisted interval are intentional.
Check out the upstream repository into upstream/, install the Go dependencies, set LLM_API_KEY, and run:
go run ./cmd/fmhy-translate sync \
--source upstream/docs \
--destination docs \
--state .translation-state/state.json \
--config translation.json \
--forceUse --dry-run to run translation and validation without changing files or state. The state cache makes reruns incremental. If a generated file was edited directly, the command stops instead of silently overwriting it; review the change and use --force only when replacement is intended.
FMHY’s own repository and documentation remain the source of truth. Keep the upstream attribution and applicable license notices when redistributing the translated content.