Handling Localized Values

A number of resources allow for localized values containing a languageId field. The languageId is a foreign key corresponding to the id field of a Language record.

For example, Products contain:

  • a localizedData field — containing an array of objects that each have a languageId field (corresponding to the language that localized data is in
  • a description field — containing the description of the Product in that language
  • a name field — containing the name of the Product in that language

Localizing Record Values

The process of localizing record values, such as product or category names and descriptions, involves the following steps:

  1. Determining the languageId value of a supported language by fetching their ID mappings.

    Important Note: This is an IMPORTANT step as the languageId differs per client implementation.

  2. Specifying the languageIds of required values in the submitted API call. The following is a fragment from JSON object before conversion into NDJSON required by the payload format:

{
            "languageId": 1,
            "name": "Shorts",
            "description": "Short trousers"
        },
        {
            "languageId": 2,
            "name": "Culottes",
            "description": "Pièce de vêtement dans laquelle chacune des jambes s'insère séparément."
        } 

For other examples of localized fields using languageId values, such as language preferences or product names, see the samples in the tutorial.

Note: Tulip applications do not handle custom attribute values with a languageId of 0 as localized values.

Supported Languages – Tulip currently supports the following languages:

  • Chinese Simplified [zh]
  • Chinese Simplified [zh-Hans]
  • Chinese Traditional (Hong Kong) [zh-Hant-HK]
  • Chinese Traditional (Taiwan) [zh-Hant-TW]
  • English [en]
  • French (Canada) [fr-CA]
  • French [fr]
  • German [de]
  • Italian [it]
  • Japanese [ja]
  • Korean [ko]
  • Portuguese [pt]
  • Spanish [es]