Skip to content

CMS Switch Language

Initial Chat Language

If a new user enters the chat the language will be determined by the follwing cascade:

  • configured language in chat init
    website chat: in init function (see website chat chapter)
    mobile chat: as URL parameter in mobile chat lg=en

  • language fallback as defined in client configuration e.g. "defaultLg": "en"

  • user can switch language during conversation by NLP or button click/tap

To identify the language it is recommended to use ISO 639-1 code.

Switch language during conversation

In order to switch language a quick-reply button or NLP can be used. Both ways must trigger an element containing the new langauge as a JSON parameter.
To change language for a single customer set this attribute lg with the correct language code (ISO 639-1).

example to switch to englisch :

{
    "elementCode": "language-switch-to-en",
    "elementType": "text",
    "txt": {
        "en": "From now on English."
    },
    "lg": "en"
}

The language switch will be executed prior to any rendering.

To make a language switch available from NLP intent and parameters matching the ones from your NLP provider must be added:

NLP example (intentCode and parameterCode must match the NLP configuration)

{
    "elementCode": "language-switch-to-en",
    "elementType": "text",
    "txt": {
        "en": "From now on English."
    },
    "lg": "en",
    "intent": [
        {
            "intentCode": "change.language",
            "parameterCode": "english"
        }
    ]
}