Concepts

Localization

How locale arrays and the locales query parameter work in the DTPR API.

Localization

All user-facing text in the DTPR API is returned as locale arrays — arrays of objects containing a language code and the localized string value.

Locale array format

Every text field (titles, descriptions, prompts, labels, etc.) follows this pattern:

[
  { "locale": "en", "value": "Technology" },
  { "locale": "fr", "value": "Technologie" },
  { "locale": "es", "value": "Tecnolog\u00eda" }
]

Each object has:

  • locale — A language or region code (e.g., en, fr, es, km, pt, tl, fr-CA)
  • value — The localized text string

Available locales

The DTPR taxonomy currently includes content in these locales:

CodeLanguage
enEnglish
frFrench
esSpanish
ptPortuguese
tlTagalog
kmKhmer

Filtering with the locales parameter

The v1 typed endpoints and every v2 read endpoint accept an optional locales query parameter. Base URL: https://api.dtpr.io.

GET /api/v1/elements/device?locales=en
GET /api/v1/elements/ai?locales=en,fr
GET /api/v1/categories/device?locales=en,es
GET /api/v2/schemas/{version}/elements?locales=en,fr
Two endpoints are exceptions. GET /api/v1/elements — the untyped v1 elements endpoint — returns 500 Server Error for any effective locales value; that is a defect in the frozen v1 surface, reproduced deliberately rather than repaired. And GET /api/v0/{locale} ignores locales entirely, because each v0 document is single-locale already.

When provided, the API filters all locale arrays in the response to include only the requested locales. This affects:

  • Element title, description, citation
  • Element icon.alt_text
  • Element variable label arrays
  • Category name, description, prompt
  • Category element_variables[].label arrays

When omitted, all available locales are returned.

Implementation notes

  • Locale codes are matched exactly — en will not match en-US
  • If a requested locale doesn't exist for a field, that field's array will be empty
  • The locales parameter accepts a comma-separated list with no spaces
Copyright © 2026