🌐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 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 object with the new customer_language value and then call signalLayer. This will trigger a new quote 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) => {
    // requestData is your quote request object
    requestData.customer_language = lang;
    window.signalLayer({
        signal: 'set',
        element: 'xce-protection-offer',
        data: { quote_request: requestData, order_total: 300 },
        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.

Any time a language is not available our Language services will return english content as fallback.

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.

en	English
en-us	English (US)
ar	Arabic
az	Azerbaijani
be	Belarusian
bg	Bulgarian
ca	Catalan
zh-hans	Chinese Simplified
zh-hant	Chinese Traditional 
hr	Croatian
cs	Czech
da	Danish
nl	Dutch
et	Estonian
fil	Filipino (Philippines)
fi	Finnish
fr	French
ka	Georgian
de	German
el	Greek
he	Hebrew
hu	Hungarian
is	Iceland
id	Indonesian
it	Italian
ja	Japanese
ko	Korean
lv	Latvian
lt	Lithuanian
ms	Malay
mt	Maltese
no	Norwegian
pl	Polish
pt	Portuguese
pt-br	Portuguese (Brazilian)
ro	Romanian
ru	Russian
sr	Serbian
sk	Slovak
sl	Slovenian
es	Spanish
es-mx	Spanish (Mexico)
sw	Swahili
sv	Swedish
tl	Tagalog
th	Thai
tr	Turkish
uk	Ukrainian
vi	Vietnamese

Last updated