# Interface: FidesLocaleEvent

FidesJS dispatches a `FidesLocaleUpdated` event when the user changes the language using the language selector in the UI. This event is separate from the consent-focused [FidesEvent](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesEvent/index.html) types and has a simple structure containing only the newly selected locale.

This event extends the standard [CustomEvent (opens in a new tab)](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) interface and includes a [detail](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#detail/index.html) object with the locale and timestamp.

## Example [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#example/index.html)

```
window.addEventListener("FidesLocaleUpdated", (evt) => {
  console.log(`Language changed to: ${evt.detail.locale}`);
});
```

For more information on working with these kind of `CustomEvent` objects in the browser, see the MDN docs:
[https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent (opens in a new tab)](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)

### Event Type [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#event-type/index.html)

- `FidesLocaleUpdated`: Dispatched when the user changes the language using the language selector in the FidesJS UI. This event fires after the locale has been successfully changed and applied to the UI.

**Note**: This event is intentionally separate from consent-related [FidesEvent](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesEvent/index.html) types. It does not include consent data or the complex `extraDetails` structure. It will not be forwarded to GTM or other consent-focused integrations.

## Extends [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#extends/index.html)

- `CustomEvent`

## Properties [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#properties/index.html)

### detail [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#detail/index.html)

> **detail**: `object`

Event properties passed when the locale is updated.

#### locale [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#locale/index.html)

> **locale**: `string`

The newly selected locale (e.g., "en", "fr", "es", "de") which will match the Fides.locale value. See [Fides.locale](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/Fides#locale/index.html) for detail.

#### timestamp? [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#timestamp/index.html)

> `optional` **timestamp**: `number`

High-precision timestamp from [performance.mark() (opens in a new tab)](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) representing when this event was created. The timestamp is measured in milliseconds since page load.

May be undefined if the Performance API is not available.

#### Example [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#example-1/index.html)

```
window.addEventListener("FidesLocaleUpdated", (evt) => {
  console.log(`Locale: ${evt.detail.locale}`);
  console.log(`Timestamp: ${evt.detail.timestamp}ms`);
});
```

#### Overrides [Permalink for this section](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesLocaleEvent#overrides/index.html)

`CustomEvent.detail`

[FidesExperienceConfig](/content/docs/privacy-center-fidesjs/fidesjs/reference/interfaces/FidesExperienceConfig "FidesExperienceConfig"/index.html) [PrivacyNoticeRegion](/content/docs/privacy-center-fidesjs/fidesjs/reference/enumerations/PrivacyNoticeRegion "PrivacyNoticeRegion"/index.html)
