LocalizedLabels

Object

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.

Fields

FieldTypeDescription
[key: string]stringDynamic 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:

This object is returned by the Get app settings endpoint as part of the data.settings.localizedLabels field.

Key categories

The keys in the LocalizedLabels object follow four distinct patterns:

1. Unit price label

This pattern (UnitPriceLabel) consists of a single key for the unit price label.

KeyTypeDescription
unitPricestringLabel for the unit price (e.g., "Unit price")

2. Unit price value

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 keyDescription
unitPrice_weight_value_kgLabel for weight unit "kg" in unit price context
unitPrice_length_value_mLabel for length unit "m" in unit price context
unitPrice_area_value_m²Label for area unit "m²" in unit price context
unitPrice_volume_value_LLabel for volume unit "L" in unit price context
unitPrice_time_value_hLabel for time unit "h" in unit price context

String values contain tokens that should be replaced with actual values when displaying the labels.

Token replacement

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)

3. Net measurement label

This pattern (NetMeasurementLabel) follows this structure:

Pattern: net{Capitalize<measurementType>}

KeyTypeDescription
netWeightstringLabel for net weight measurement (e.g., "Net weight")
netLengthstringLabel for net length measurement (e.g., "Net length")
netAreastringLabel for net area measurement (e.g., "Net area")
netVolumestringLabel for net volume measurement (e.g., "Net volume")
netTimestringLabel for net time measurement (e.g., "Net time")

4. Net measurement value

This pattern (NetMeasurementValue) follows this structure:

Pattern: {NetMeasurementLabel}_value_{measurementUnit}

Example keyDescription
netWeight_value_kgLabel for net weight unit "kg"
netLength_value_mLabel for net length unit "m"
netArea_value_m²Label for net area unit "m²"
netVolume_value_LLabel for net volume unit "L"
netTime_value_hLabel for net time unit "h"

String values contain tokens that should be replaced with actual values when displaying the labels.

Token replacement

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 structure

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"
}