Translator service API: GET/POST /_api/translate/{lang}
This commit is contained in:
+6
-1
@@ -91,7 +91,12 @@ alternate links never enumerate chunks. It is written by whoever writes
|
||||
translation data, in the same transaction:
|
||||
|
||||
- **Translator job:** after writing `trans[h][lang]` entries for an
|
||||
article's chunks (or its title), set `node.langs[lang] = True`.
|
||||
article's chunks (or its title), set `node.langs[lang] = True`. The
|
||||
translation service API does both: `GET /_api/translate/{lang}` lists
|
||||
pending items (titles + translatable chunks lacking an entry, deduped by
|
||||
hash), `POST /_api/translate/{lang}` stores a batch into `trans`, sets
|
||||
`langs` on every article that gained an entry and invalidates the page
|
||||
cache — all in one transaction.
|
||||
- **Translated-view save:** appending the first patch for `f"{path}:{lang}"`
|
||||
sets `node.langs[lang] = True` (patches alone make the version exist).
|
||||
- **Removals:** deleting a patch or GC'ing translations re-derives the key:
|
||||
|
||||
Reference in New Issue
Block a user