API Reference - Label Translations
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108115
← Back to API Reference | Getting Started
Label Translations
Label Translations provide per-language overrides for individual website labels. While the website_labels table stores translations as columns (result_de, result_fr, result_es), this table stores translations for any locale using an IETF language code (EG en-US, de-DE, fr-FR). Each record maps a label field key to a specific language and translated value.
website_labels_translation — DB table: website_labels_translationThe Label Translation Object
| Field | Type | Description |
|---|---|---|
id | integer | Unique translation ID (primary key, read-only) |
field | string | The label key this translation applies to (must match a field value in website_labels); max 255 characters required on create |
language_code | string | IETF language code for this translation (EG en-US, de-DE, fr-FR, es-ES); max 10 characters required on create |
value | text | The translated text for this label in the specified language required on create |
category | string | Grouping category matching the parent label's category (EG textLabel); max 255 characters |
List Label Translations
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/website_labels_translation/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"id": "1",
"field": "company_label2",
"language_code": "en-US",
"value": "company",
"category": "textLabel"
}
],
"total": "233",
"current_page": 1,
"total_pages": 10,
"next_page": "MipfKjI1"
}Retrieve a Label Translation
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/website_labels_translation/get/1" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"id": "1",
"field": "company_label2",
"language_code": "en-US",
"value": "company",
"category": "textLabel"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Create a Label Translation
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/website_labels_translation/create" \ -H "X-Api-Key: your-api-key-here" \ -d "field=company_label2" \ -d "language_code=de-DE" \ -d "value=Unternehmen" \ -d "category=textLabel"
Example Response
{
"status": "success",
"message": {
"id": "251",
"field": "company_label2",
"language_code": "de-DE",
"value": "Unternehmen",
"category": "textLabel"
}
}Update a Label Translation
Example Request
curl -X PUT "https://www.yourdomain.com/api/v2/website_labels_translation/update" \ -H "X-Api-Key: your-api-key-here" \ -d "id=251" \ -d "value=Firma"
Example Response
{
"status": "success",
"message": {
"id": "251",
"field": "company_label2",
"language_code": "de-DE",
"value": "Firma",
"category": "textLabel"
}
}Delete a Label Translation
Example Request
curl -X DELETE "https://www.yourdomain.com/api/v2/website_labels_translation/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "id=251"
Example Response
{
"status": "success",
"message": "website_labels_translation record was deleted"
}