Language

This page outlines how to set and update XCE content language

During partner onboarding, discuss the required languages with the CSE to ensure content is readily available in the platform. See the list of available languages below.

Once the content variations are created they will be made available through our element to our partners using set signal. Here's how it works:

  • Initial language state: To set the initial language state the element will refer to the set signal data.offer_request object property customer_language. The value will represent the preferred language for the element's content.

  • Updating language state: To update the element's content language state we must update the set signal data.offer_request object with the new customer_language value and then call signalLayer. This will trigger a new offer request and update the element language state respectively.

Here's an snippet example of a callback function for a toggle component to dynamically update state:

// Callback function to update language
const toggleLanguage = (lang) => {
  window.signalLayer({
    signal: 'set',
    element: 'xce-protection-offer',
    data: {
      offer_request: {
        // for this example, requestData is your offer request object defined
        ...requestData,
        customer: {
          language: lang,
        },
      }
    },
    onSet,
  });
};

Note: Any time the customer_language is updated, our built in currency formatter will use it as the locale value to align currency accordingly. Please go to Currency Formatting Engine for more information on how it works.

Language Codes

The languages supported by XCE are a combination of languages in ISO-639-1 and RFC 5646.

See the below table for the language codes we accept. Note that language content is available "as needed" to partners using XCE, discuss with your CSE for more information.

Last updated