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.

Model name in URL: website_labels_translation — DB table: website_labels_translation

The Label Translation Object

FieldTypeDescription
idintegerUnique translation ID (primary key, read-only)
fieldstringThe label key this translation applies to (must match a field value in website_labels); max 255 characters required on create
language_codestringIETF language code for this translation (EG en-US, de-DE, fr-FR, es-ES); max 10 characters required on create
valuetextThe translated text for this label in the specified language required on create
categorystringGrouping category matching the parent label's category (EG textLabel); max 255 characters

List Label Translations

GET /api/v2/website_labels_translation/get

Example Request

Copy
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

Copy
{
  "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

GET /api/v2/website_labels_translation/get/{id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/website_labels_translation/get/1" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "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

POST /api/v2/website_labels_translation/create

Example Request

Copy
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

Copy
{
  "status": "success",
  "message": {
    "id": "251",
    "field": "company_label2",
    "language_code": "de-DE",
    "value": "Unternehmen",
    "category": "textLabel"
  }
}

Update a Label Translation

PUT /api/v2/website_labels_translation/update

Example Request

Copy
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

Copy
{
  "status": "success",
  "message": {
    "id": "251",
    "field": "company_label2",
    "language_code": "de-DE",
    "value": "Firma",
    "category": "textLabel"
  }
}

Delete a Label Translation

DELETE /api/v2/website_labels_translation/delete

Example Request

Copy
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

Copy
{
  "status": "success",
  "message": "website_labels_translation record was deleted"
}