Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt

Use this file to discover all available pages before exploring further.

Changes the display language of the chat widget at runtime. By default, the locale is English (en).

Syntax

await instance.updateLocale(locale);

Parameters

locale
string
required
A locale string representing the desired language and region. For the supported locales, see Supported locales.

Returns

Promise<void>
A promise that resolves when the locale is updated.

Examples

The following examples show different ways to change the locale:
// Change to Japanese
await instance.updateLocale('ja');

// Change to Brazilian Portuguese
await instance.updateLocale('pt-BR');

// Change based on user selection
const userLanguage = getUserPreferredLanguage();
await instance.updateLocale(userLanguage);

Considerations

Supported locales

LanguageLanguage Code
Chinese - Simplifiedzh-CN
Chinese - Traditionalzh-TW
Englishen
Frenchfr
Germande
Italianit
Japaneseja
Koreanko
Portuguese - Brazilpt-BR
Spanishes

Do you need practical examples?

Learn how to apply the features available for embedded chat into your implementation with guidance and examples.