The LocalizedLabels object contains localized text labels for various UI elements in the application. These labels are returned based on the locale specified in the request, or the default locale if none is provided or if the requested locale has no labels. The object uses dynamic keys that follow specific patterns based on measurement types and units.
| Field | Type | Description |
|---|---|---|
[key: string] | string | Dynamic keys following specific patterns (see key categories below). Keys are not arbitrary—they must match one of four patterns: unit price label, unit price value, net measurement label, or net measurement value. Each key maps to a localized string value. |
Note
The LocalizedLabels object is returned as part of the app settings response. The labels are localized based on the locale query parameter provided in the request.
If no locale is specified, the default locale (en) is used. If a locale is specified but no labels exist for that locale, the default locale (en) is used instead.
The API returns a different LocalizedLabels object based on the requested locale, but the object itself is a flat structure with keys following specific patterns. The keys are dynamically generated based on enabled measurement types and their available units.
Related:
data.settings.localizedLabels field.The keys in the LocalizedLabels object follow four distinct patterns:
This pattern (UnitPriceLabel) consists of a single key for the unit price label.
| Key | Type | Description |
|---|---|---|
| unitPrice | string | Label for the unit price (e.g., "Unit price") |
This pattern (UnitPriceValue) follows this structure:
Pattern: unitPrice_{measurementType}_value_{measurementUnit}
Where measurementType is a value from the MeasurementType enum, and measurementUnit is a value from the MeasurementUnit union type.
| Example key | Description |
|---|---|
| unitPrice_weight_value_kg | Label for weight unit "kg" in unit price context |
| unitPrice_length_value_m | Label for length unit "m" in unit price context |
| unitPrice_area_value_m² | Label for area unit "m²" in unit price context |
| unitPrice_volume_value_L | Label for volume unit "L" in unit price context |
| unitPrice_time_value_h | Label for time unit "h" in unit price context |
String values contain tokens that should be replaced with actual values when displaying the labels.
These keys contain the following tokens: {Price}, {Quantity}, and {Quantity_With_Space}.
{Price} - The formatted price value (e.g., "$10.00"){Quantity} - The quantity value without space before the unit (e.g., "5kg"). When quantity is 1, this token is ignored and not displayed.{Quantity_With_Space} - The quantity value with space before the unit (e.g., "5 kg"). When quantity is 1, this token is ignored and not displayed.Examples:
Template: {Price} per {Quantity}kg
Result (quantity = 5): $10.00 per 5kg
Result (quantity = 1): $10.00 per kg (quantity token ignored)
Template: {Price} per {Quantity_With_Space}kg
Result (quantity = 5): $10.00 per 5 kg
Result (quantity = 1): $10.00 per kg (quantity token ignored)
This pattern (NetMeasurementLabel) follows this structure:
Pattern: net{Capitalize<measurementType>}
| Key | Type | Description |
|---|---|---|
| netWeight | string | Label for net weight measurement (e.g., "Net weight") |
| netLength | string | Label for net length measurement (e.g., "Net length") |
| netArea | string | Label for net area measurement (e.g., "Net area") |
| netVolume | string | Label for net volume measurement (e.g., "Net volume") |
| netTime | string | Label for net time measurement (e.g., "Net time") |
This pattern (NetMeasurementValue) follows this structure:
Pattern: {NetMeasurementLabel}_value_{measurementUnit}
| Example key | Description |
|---|---|
| netWeight_value_kg | Label for net weight unit "kg" |
| netLength_value_m | Label for net length unit "m" |
| netArea_value_m² | Label for net area unit "m²" |
| netVolume_value_L | Label for net volume unit "L" |
| netTime_value_h | Label for net time unit "h" |
String values contain tokens that should be replaced with actual values when displaying the labels.
These keys contain the following tokens: {Quantity} and {Unit}.
{Quantity} - The measurement quantity value{Unit} - The measurement unit (e.g., "kg", "m", "L")Examples:
Template: {Quantity} kg
Result: 5 kg
Template: {Quantity} g
Result: 250 g
Template: {Quantity} lb
Result: 2.5 lb
Example LocalizedLabels object for weight measurement type (showing template strings with tokens):
{
"unitPrice": "Unit price",
"netWeight": "Net weight",
"unitPrice_weight_value_kg": "{Price} per {Quantity}kg",
"unitPrice_weight_value_g": "{Price} per {Quantity}g",
"unitPrice_weight_value_lb": "{Price} per {Quantity}lb",
"unitPrice_weight_value_oz": "{Price} per {Quantity}oz",
"netWeight_value_kg": "{Quantity} kg",
"netWeight_value_g": "{Quantity} g",
"netWeight_value_lb": "{Quantity} lb",
"netWeight_value_oz": "{Quantity} oz"
}