Skip to main content

Languages API

The Languages API provides endpoints for managing languages and language overrides in Joomla.

Base URL

/api/index.php/v1/languages

Endpoints Overview

Content Languages

MethodEndpointDescription
GET/languages/contentRetrieve all content languages
GET/languages/content/{id}Retrieve specific language
POST/languages/contentCreate new content language
PATCH/languages/content/{id}Update content language
DELETE/languages/content/{id}Delete content language

Language Overrides

MethodEndpointDescription
GET/languages/overrides/{app}/{lang}Retrieve overrides
POST/languages/overrides/{app}/{lang}Create override
PATCH/languages/overrides/{app}/{lang}/{key}Update override
DELETE/languages/overrides/{app}/{lang}/{key}Delete override

Content Languages

Retrieve all content languages

GET /api/index.php/v1/languages/content

Response

{
"data": [
{
"type": "languages",
"id": "1",
"attributes": {
"lang_code": "en-GB",
"title": "English (UK)",
"title_native": "English",
"sef": "en",
"image": "en_gb",
"description": "",
"metakey": "",
"metadesc": "",
"sitename": "",
"published": 1,
"access": 1,
"ordering": 1
}
}
]
}

Create content language

POST /api/index.php/v1/languages/content

Request Body

{
"lang_code": "de-DE",
"title": "German (DE)",
"title_native": "Deutsch",
"sef": "de",
"image": "de_de",
"published": 1,
"access": 1
}

Required fields

FieldTypeDescription
lang_codestringLanguage code (e.g. en-GB)
titlestringLanguage title
title_nativestringNative name of the language
sefstringSEF prefix for URLs

Optional fields

FieldTypeDefaultDescription
imagestring""Flag image code
descriptionstring""Description
metakeystring""Meta keywords
metadescstring""Meta description
sitenamestring""Site name for language
publishedint1Publication status
accessint1Access level

Example

curl -X POST "https://yoursite.com/api/index.php/v1/languages/content" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"lang_code": "fr-FR",
"title": "French (FR)",
"title_native": "Français",
"sef": "fr"
}'

Update content language

PATCH /api/index.php/v1/languages/content/{id}

Example

curl -X PATCH "https://yoursite.com/api/index.php/v1/languages/content/1" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sitename": "My English Site"
}'

Language Overrides

Language overrides allow you to customize default Joomla translations.

Retrieve overrides

GET /api/index.php/v1/languages/overrides/{app}/{lang}
ParameterValuesDescription
appsite, administratorFrontend or backend
langen-GB, nl-NL, etc.Language code

Example

curl -X GET "https://yoursite.com/api/index.php/v1/languages/overrides/site/en-GB" \
-H "X-Joomla-Token: YOUR_API_TOKEN"

Response

{
"data": [
{
"type": "language-overrides",
"attributes": {
"key": "MOD_LOGIN_VALUE_USERNAME",
"value": "Username",
"app": "site",
"language": "en-GB"
}
}
]
}

Create override

POST /api/index.php/v1/languages/overrides/{app}/{lang}

Request Body

{
"key": "CUSTOM_LANGUAGE_STRING",
"value": "My custom text"
}

Example

curl -X POST "https://yoursite.com/api/index.php/v1/languages/overrides/site/en-GB" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"key": "MOD_LOGIN_VALUE_USERNAME",
"value": "Email address"
}'

Update override

PATCH /api/index.php/v1/languages/overrides/{app}/{lang}/{key}

Example

curl -X PATCH "https://yoursite.com/api/index.php/v1/languages/overrides/site/en-GB/MOD_LOGIN_VALUE_USERNAME" \
-H "X-Joomla-Token: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"value": "New translation"
}'

Delete override

DELETE /api/index.php/v1/languages/overrides/{app}/{lang}/{key}

Example

curl -X DELETE "https://yoursite.com/api/index.php/v1/languages/overrides/site/en-GB/MOD_LOGIN_VALUE_USERNAME" \
-H "X-Joomla-Token: YOUR_API_TOKEN"

Installed Languages

Retrieve installed languages

GET /api/index.php/v1/languages/installed

This shows all installed language packages.

Language States

ValueStatus
-2Trash
0Unpublished
1Published

Common Language Codes

CodeLanguage
en-GBEnglish (UK)
en-USEnglish (US)
nl-NLDutch
de-DEGerman
fr-FRFrench
es-ESSpanish
it-ITItalian
pt-BRPortuguese (BR)

Multilingual Site Setup

For a multilingual site you need:

  1. Install language packages via Extension Manager
  2. Create Content Languages via this API
  3. Activate Language Filter plugin
  4. Link languages to menu items
tip

Use the System - Language Filter plugin to automatically detect the correct language based on browser settings or URL prefix.

Example: Search language strings

To find which key to override:

# Search in Joomla language files
grep -r "Username" /path/to/joomla/language/en-GB/

Or use the Language Overrides tool in the Joomla administrator.