> ## 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.

# getLocale()

Returns the language code for the current language that the chat widget uses, for example, `en` for English or `fr` for French. If a region is specified, it returns the language and region codes, for example, `pt-BR` for Brazilian Portuguese.

## Syntax

```javascript theme={null}
const locale = instance.getLocale();
```

## Parameters

<ParamField path="None" />

## Returns

<ResponseField name="string">
  The current locale code, for example, `en`, `fr`, `pt-BR`.
</ResponseField>

## Examples

The following example gets the current locale:

```javascript theme={null}
// Get current locale
const currentLocale = instance.getLocale();
console.log('Current locale:', currentLocale);

// Use locale to customize behavior
if (instance.getLocale() === 'ja') {
    console.log('Japanese locale is active');
}
```

<Card title="Do you need practical examples?" icon="text-align-start" href="https://www.ibm.com/docs/SSAVQO/deploy/web_chat_agent/tutorials/tutorials_lp.html" arrow="true" cta="Learn with walk-throughs" horizontal>
  Learn how to apply the features available for embedded chat into your implementation with guidance and examples.
</Card>
