Skip to content

REST API

LocaleReady’s admin screens are React apps talking to WordPress’s REST API, under the localeeasy/v1 namespace. Every route here requires a signed-in session with manage_options (or the specific post’s own edit capability, where noted) — nothing is open to an anonymous request.

GET /localeeasy/v1/settings — every saved setting, plus the context needed to render the Settings screen: which languages are known, which translation services are connected, and current usage against the monthly limit.

POST /localeeasy/v1/settings — save any subset of settings. Only the keys sent are changed; anything omitted is left alone.

POST /localeeasy/v1/settings/pretranslate — queue a one-time scan that pretranslates the whole site into every enabled language.

POST /localeeasy/v1/settings/test-provider — send a short piece of text to one connected translation service and return what came back, without storing it. A real, billed request, subject to the same monthly limit as anything else.

POST /localeeasy/v1/settings/switcher-preview — render the language switcher for a set of defaults that have not been saved yet, using the same renderer the front end uses — what powers the live preview on the Visitors tab.

GET /localeeasy/v1/translations — a filterable, paginated list of stored translations.

GET /localeeasy/v1/translations/export — export the whole translation memory (or a filtered slice of it) as JSONL, CSV, or XLIFF 1.2, for a human translator’s own tools.

POST /localeeasy/v1/translations/import — import a JSONL, CSV, or XLIFF file back in. Existing manual and locked rows are left alone unless you explicitly choose to overwrite them.

POST /localeeasy/v1/translations/{id} — update one translation’s stored text.

DELETE /localeeasy/v1/translations/{id} — delete one stored translation; it is machine-translated again the next time it is needed.

POST /localeeasy/v1/translations/{id}/action — run one of four actions on a single row: revert (drop a manual correction back to the machine translation), regenerate (translate it again from scratch), refine (run the AI improvement pass), or unlock.

POST /localeeasy/v1/posts/{id}/suggest-slug — translate a post’s title on demand and turn the result into a URL slug suggestion, for the translated-slug field in the block editor’s language panel. Requires the capability to edit that specific post, not manage_options.

POST /localeeasy/v1/posts/{id}/refine — run the AI improvement pass over one post’s translation in one language; the same action the editor’s Improve with AI button calls. Also scoped to that post’s own edit capability.

The public-facing translation itself — what a visitor’s browser actually receives — is not a separate API call. LocaleReady reads and rewrites the response WordPress was already going to send, for the ordinary page request, the REST response, or the AJAX call your theme or plugins already make. See hooks and filters for the filters that shape that part.