Translations (Public)
Public endpoints for consuming translations. No authentication required. These endpoints are intended for frontend applications.
Base path: /api/v1/translations
Get All Translations
Returns all published translations for a language in a nested JSON format compatible with i18next.
Authentication: Not required
Path parameters
| Parameter | Type | Description |
|---|---|---|
language_code |
string | Language code e.g. en, sr |
Response 200 OK
{
"language": "en",
"translations": {
"common": {
"btn": {
"save": "Save changes",
"cancel": "Cancel",
"delete": "Delete"
},
"label": {
"loading": "Loading..."
}
},
"nav": {
"main": {
"home": "Home",
"about": "About",
"contact": "Contact"
}
},
"pages": {
"home": {
"title": "Welcome",
"subtitle": "Glad to have you here"
}
}
}
}
Errors
| Status | Description |
|---|---|
404 |
Language not found |
Get Translations by Namespace
Returns published translations for a specific namespace only. Useful for lazy-loading translations on the frontend.
Authentication: Not required
Path parameters
| Parameter | Type | Description |
|---|---|---|
language_code |
string | Language code e.g. en, sr |
namespace |
string | Namespace e.g. common, nav |
Response 200 OK
{
"language": "en",
"translations": {
"common": {
"btn": {
"save": "Save changes",
"cancel": "Cancel"
}
}
}
}
Errors
| Status | Description |
|---|---|
404 |
Language not found |
i18next Integration
The response format is directly compatible with i18next. Example frontend setup: