Unified Frontend & Mobile Translations API
Unified Frontend & Mobile Translations API
The platform exposes one shared translation contract that works for both Inertia pages and mobile apps.
Endpoint
GET /api/translationsfor web/mobile clientsGET /locale/translationsfor authenticated web flows
Query Parameters
locale: primary locale (example:en)locales: comma-separated locales for multi-locale payloads (example:en,bn,ar)namespaces: comma-separated namespaces (example:platformkit,accounting)moduleormodules: infer namespaces by module name(s)pathorpage: infer namespaces by page route (example:admin/system/accounting/reports)
Response Shape
{
"locale": "en",
"locales": ["en", "bn"],
"namespaces": ["platformkit", "accounting"],
"translations": { ...primary locale payload... },
"translations_by_locale": {
"en": { ... },
"bn": { ... }
}
}
How Inertia Uses It
Inertia pages receive translation meta (locale + namespaces) and lazy-load actual translations from /api/translations. Responses are cached in session storage to reduce repeat requests.
How Mobile Uses It
Mobile apps can request all required namespaces and locales in a single request, then cache translations_by_locale locally for offline and fast screen rendering.
Best Practices
- Always request only required namespaces per screen/module.
- Use
localeswhen preloading language packs at app boot time. - Fallback to
enis automatic when a locale file does not exist.
Last updated: 5/20/2026