Localized strings
The Propeller REST API uses LocalizedString and LocalizedStringArray data types to handle multi-language content. These types allow you to store and retrieve content in multiple languages for entities like products, categories and surcharges.
LocalizedString
Used for fields that contain a single translatable value across multiple languages.
{
"language": "EN",
"value": "Product Name"
}
| Property | Type | Required | Description |
|---|---|---|---|
language | string | Yes | 2-character language code per ISO 639-1 |
value | string | Yes | The translated text content |
LocalizedString is typically used in arrays to represent content in multiple languages:
[
{ "language": "EN", "value": "Product Name" },
{ "language": "NL", "value": "Productnaam" },
{ "language": "DE", "value": "Produktname" }
]
LocalizedStringArray
Used for fields that contain multiple text values in multiple languages, such as tags or keywords.
{
"language": "EN",
"values": ["Tag1", "Tag2", "Tag3"]
}
| Property | Type | Required | Description |
|---|---|---|---|
language | string | Yes | 2-character language code per ISO 639-1 |
values | string[] | Yes | Array of translated text values |
LocalizedStringArray is typically used in arrays to represent multiple values in multiple languages:
[
{ "language": "EN", "values": ["Electronics", "Gadgets", "Technology"] },
{ "language": "NL", "values": ["Elektronica", "Gadgets", "Technologie"] },
{ "language": "DE", "values": ["Elektronik", "Gadgets", "Technologie"] }
]
Common use cases
Product information
Products use LocalizedString for names and descriptions, and LocalizedStringArray for keywords:
{
"names": [
{ "language": "EN", "value": "Garmin Edge 1030" },
{ "language": "NL", "value": "Garmin Edge 1030" },
{ "language": "DE", "value": "Garmin Edge 1030" }
],
"descriptions": [
{ "language": "EN", "value": "High-end cycling computer with advanced features" },
{ "language": "NL", "value": "High-end fietscomputer met geavanceerde functies" },
{ "language": "DE", "value": "High-End-Fahrradcomputer mit erweiterten Funktionen" }
],
"keywords": [
{ "language": "EN", "values": ["cycling", "computer", "GPS"] },
{ "language": "NL", "values": ["fietsen", "computer", "GPS"] },
{ "language": "DE", "values": ["Radfahren", "Computer", "GPS"] }
]
}
Attributes
Attributes use LocalizedStringArray for text values that can have multiple entries per language:
{
"textValues": [
{ "language": "EN", "values": ["Red", "Blue", "Green"] },
{ "language": "NL", "values": ["Rood", "Blauw", "Groen"] },
{ "language": "DE", "values": ["Rot", "Blau", "Grün"] }
]
}
Language codes
The API uses 2-character language codes as defined by ISO 639-1.
| Language | Code | Language | Code |
|---|---|---|---|
| English | EN | Dutch | NL |
| German | DE | French | FR |
| Spanish | ES | Italian | IT |
| Portuguese | PT | Swedish | SV |
| Norwegian | NO | Danish | DA |
| Finnish | FI | Polish | PL |
| Czech | CS | Hungarian | HU |
| Slovak | SK | Slovenian | SL |
| Croatian | HR | Serbian | SR |
| Bulgarian | BG | Romanian | RO |
| Greek | EL | Turkish | TR |
| Russian | RU | Ukrainian | UK |
| Japanese | JA | Korean | KO |
| Chinese (Simplified) | ZH | Chinese (Traditional) | ZH-TW |
| Arabic | AR | Hebrew | HE |
| Thai | TH | Vietnamese | VI |
Language codes are always uppercase.
Retrieving localized content
Get a product in a specific language:
GET /v2/products/123?language=EN
Get a product with all translations:
GET /v2/products/123?expands=translation
When a translation is not available, the API returns the default language or the first available translation.
See also
- Expanding Resources for using
?expands=translationto retrieve all language versions - REST API Reference for the full endpoint specification