Skip to content

Page Translation

6 endpoints.

Detection output plus everything the browser needs to translate and composite locally

Section titled “Detection output plus everything the browser needs to translate and composite locally”
GEThttp://localhost:3000/api/archives/{id}/page/{page}/text-regions

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/translation.rs:406), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


Detection output plus everything the browser needs to translate and composite locally.

Includes the same context the cloud path assembles, so a locally-hosted backend gets FR-007a–e’s consistency benefit even though its translation call never touches this server.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/translation.rs:45.

This response carries no example body.

Your own instance address. Requests go from this browser straight to it.

Reader’s “重新翻译”: drops this page’s detection cache, every translated record and the

Section titled “Reader’s “重新翻译”: drops this page’s detection cache, every translated record and the”
DELETEhttp://localhost:3000/api/archives/{id}/page/{page}/translation

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/translation.rs:203), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


Reader’s “重新翻译”: drops this page’s detection cache, every translated record and the rendered image, so the next GET .../translation re-runs the whole OCR -> translate -> composite pipeline instead of reusing a stale cache (e.g. one produced by an old pipeline version, or a partially-detected region set).

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/translation.rs:41.

This response carries no example body.

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

Serves the composited, translated page for the cloud-backend path (T028)

Section titled “Serves the composited, translated page for the cloud-backend path (T028)”
GEThttp://localhost:3000/api/archives/{id}/page/{page}/translation

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/translation.rs:275), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


Serves the composited, translated page for the cloud-backend path (T028).

Returns the cached rendering when one exists. On a miss it triggers the real orchestration — OCR → font routing → batched translation → compositing → cache write (translation_pipeline::translate_page) — for this page and its look-ahead window, then reports not-ready immediately.

The work is deliberately not awaited here: a full OCR + LLM cycle takes tens of seconds, and FR-012 requires the reader to keep showing the original page with a non-blocking indicator meanwhile. The client polls; a later poll finds the cache entry this triggered. Reading must never wait on translation (SC-007).

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/translation.rs:41.

This response carries no example body.

Your own instance address. Requests go from this browser straight to it.

Records a translation the browser obtained from its own local model (T049a)

Section titled “Records a translation the browser obtained from its own local model (T049a)”
POSThttp://localhost:3000/api/archives/{id}/page/{page}/translation/record

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/translation.rs:587), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


Records a translation the browser obtained from its own local model (T049a).

No LLM call happens here — this is a lightweight write. Its purpose is that a name/term the local backend translated still reaches the shared, server-stored glossary, so later cloud-path (or other-device) requests for the same volume stay consistent with it.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/translation.rs:49.

This response carries no example body.

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.

Reports whether translation is on for this archive, and whether that’s this archive’s own

Section titled “Reports whether translation is on for this archive, and whether that’s this archive’s own”
GEThttp://localhost:3000/api/archives/{id}/translation/scope

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/translation.rs:118), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


Reports whether translation is on for this archive, and whether that’s this archive’s own setting or inherited from a Tankoubon it belongs to — the latter so the reader can tell the user “this follows the whole book’s setting” rather than presenting it as if toggling here only ever affects this one file.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/translation.rs:53.

This response carries no example body.

Your own instance address. Requests go from this browser straight to it.

Sets the switch for whichever scope actually governs this archive right now (its Tankoubon if

Section titled “Sets the switch for whichever scope actually governs this archive right now (its Tankoubon if”
PUThttp://localhost:3000/api/archives/{id}/translation/scope

Not yet described in this reference. This endpoint is listed because the server registers it, but its request and response shapes have not been written down yet.

The note below is the handler’s own documentation comment (crates/lanrurugi-api/src/translation.rs:144), quoted verbatim. It is written for maintainers of this codebase and may reference internal identifiers.


Sets the switch for whichever scope actually governs this archive right now (its Tankoubon if it has one, else the archive itself) — see TranslationScopeRepository::set_enabled’s own docs for why toggling here only ever targets one or the other, never both.

Responses

200The endpoint responded. Its exact shape is not documented yet — see the handler at crates/lanrurugi-api/src/translation.rs:53.

This response carries no example body.

This endpoint needs an administrator token — a guest (read-only) token is refused by the server.

Your own instance address. Requests go from this browser straight to it.