i18n
- Sells as: the
i18nproduct (a product-scoped API key). This capability has no separate product-face contract — its public product route reuses the capability contract below; see the Edge route table's Product face row.
Multi-provider translation + UI-string i18n capability. Machine translation over a provider fallback chain (LibreTranslate | LLM | Bhashini | Stub) with H2 breaker/retry/timeout; language detection (langdetect + Unicode heuristic); a UI-string dictionary registry with a 3-level fallback chain (locale -> 'en' -> raw key); RTL/locale metadata; and entity-content translation (generalizes translate-article). Every endpoint carries organization_id (I6 product-tier tenant); MT output is org-namespaced so tenants never share a cached translation.
- Group: Governance & platform
- Contract:
contracts/i18n/v1/openapi.yaml - Console: Manage the
i18nproduct in the console → - Runbook: operational checklist for
i18n— internal (Vagary Labs ops; not part of this public site):docs/runbooks/capability-operations.md#i18n - Public base:
https://api.vagarylabs.com(the consolidated API gateway — one host, per-brand siblingapi.<zone>) - Auth: a product API key (
vgk_…) issued from the console —Authorization: Bearer vgk_… - Product face (customer-keyed):
https://api.vagarylabs.com/product/v1/i18n/translate
Edge route table
The routes this capability actually serves on the public edge — live-synced from GET https://api.vagarylabs.com/product/v1/_meta/catalog (snapshot v1). The metric is the request-granularity billing counter; the scope is the key permission required.
Product face (customer-keyed)
| Method | Path | Metric | Scope |
|---|---|---|---|
POST | /product/v1/i18n/translate | translations | read |
Endpoints
| Method | Path | Summary |
|---|---|---|
GET | /health | liveness + provider readiness (open, tailnet-scoped) |
GET | /metrics | Prometheus text exposition (open, tailnet-scoped) |
POST | /v1/i18n/translate | machine-translate text over the provider fallback chain (cached, org-namespaced) |
POST | /v1/i18n/translate/batch | machine-translate a batch of texts (cap 100), same source/target |
GET | /v1/i18n/languages | languages supported for machine translation (live from provider, else static union) |
POST | /v1/i18n/detect | detect the language of a text (langdetect + Unicode heuristic fallback) |
GET | /v1/i18n/locales | available UI-string locales + supported-language display metadata (RTL/flag/name) |
GET | /v1/i18n/locales/{locale} | the merged UI-string bundle for a locale (locale dict over the 'en' fallback dict) |
POST | /v1/i18n/translate-entity | translate a product ENTITY's named text fields, cached by (org, entity_type, entity_ref, target). Generalizes platform's translate-article. The product SUPPLIES the fields (I1/I4 — core never fetches from a product DB); on a cache HIT the fields may be omitted. |
Schemas
Error
| Field | Type | Description |
|---|---|---|
error | string | stable machine code (slug), e.g. validation_error, unauthorized, payload_too_large |
reason | string | human-readable one-line explanation (no secrets/PII) |
detail | object | |
request_id | string |
Generated by scripts/gen-capability-docs.py from contracts/i18n/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page. The Edge route table section is synced from the live edge catalog snapshot (v1) — re-sync with python3 scripts/sync-edge-catalog.py.