Skip to main content

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"
}
PropertyTypeRequiredDescription
languagestringYes2-character language code per ISO 639-1
valuestringYesThe 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"]
}
PropertyTypeRequiredDescription
languagestringYes2-character language code per ISO 639-1
valuesstring[]YesArray 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.

LanguageCodeLanguageCode
EnglishENDutchNL
GermanDEFrenchFR
SpanishESItalianIT
PortuguesePTSwedishSV
NorwegianNODanishDA
FinnishFIPolishPL
CzechCSHungarianHU
SlovakSKSlovenianSL
CroatianHRSerbianSR
BulgarianBGRomanianRO
GreekELTurkishTR
RussianRUUkrainianUK
JapaneseJAKoreanKO
Chinese (Simplified)ZHChinese (Traditional)ZH-TW
ArabicARHebrewHE
ThaiTHVietnameseVI
important

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