DetectLanguage

detectLanguage

Use this method to retrieve the language of a user question (UQ). If the language of the UQ is not related to the language of the project instances, it returns the actual instance language.

Usage

client.detectLanguage(query: String, options: Object);

Query

The query is the value of the user question (UQ) for which you want to detect the language.

Options

Name Type Default  Description
tracking Boolean true If set to true it will automatically track the language detection event.

Response data format

The response looks like this:

{
    "language": "en"
}

Example

client.detectLanguage('What is the language of this question?', {
    tracking: false
});