America's Future · born between 2 generals

BBG Translation Service

Backend for the Language section of the fleet accessibility widget (a11y.bornbetween2generals.com/a11y.js). It translates a batch of on-page strings into one of 24 languages so any app can be read — and spoken aloud — in the visitor's language.

Endpoint

POST /api/translate
Content-Type: application/json

{ "lang": "uk", "texts": ["Read more", "Get involved"], "context": "optional page title" }

-> { "translations": ["Читати далі", "Долучитися"], "lang": "uk", "model": "..." }

Limits: 200 strings, 4,000 chars per string, 60,000 chars per request. Failed batches fall back to the original English rather than blanking the page.

Configuration

Env varPurpose
ANTHROPIC_API_KEYRequired.
TRANSLATE_MODELDefaults to claude-haiku-4-5. Set to claude-opus-5 for higher-fidelity prose.
TRANSLATE_ALLOW_ORIGINSComma-separated extra domains. Use * to open it up.

By default, requests are accepted from bornbetween2generals.com, americasfuture.net, verify1st.app, *.vercel.app, and localhost.

Supported: Spanish, French, German, Ukrainian, Portuguese, Italian, Polish, Russian, Simplified Chinese, Japanese, Korean, Arabic, Hebrew, Persian, Hindi, Vietnamese, Tagalog, Somali, Haitian Creole, Swahili, Turkish, Dutch, Romanian, Greek.