# Localization for the Web SDK

Override the user's default locale to utilize localization for a specific language.
See [Localization](https://www.airship.com/docs/guides/messaging/messages/localization/) in our message content documentation for more details.

## Overriding locale

Airship uses the user's [Locale](https://www.airship.com/docs/reference/glossary/#locale) for various locale-sensitive tasks, including selecting the language for messages and reporting for analytics. The SDK can override the locale so that Airship uses a different locale than the browser's current locale.

In the Web SDK, a locale can be set before or after creating a channel. If set, it overrides the browser's locale information. See the Web SDK reference for the full [Locale Manager](https://www.airship.com/docs/reference/libraries/web-notify-sdk/v2-latest/LocaleManager.html)
.

**Setting the locale language:**


```js
const sdk = await UA
await sdk.locale.set({language: 'fr'})
```


**Setting the locale country:**


```js
const sdk = await UA
await sdk.locale.set({country: 'FR'})
```


**Clear the locale override:**


```js
const sdk = await UA
await sdk.locale.clear()
```


**Setting/replacing locale:**


```js
const sdk = await UA
// replace just the language
await sdk.locale.set({language :'fr'})
// replace just the country
await sdk.locale.set({country :'FR'})
// replace both
await sdk.locale.set({country :'fr', language :'fr'})
```


Overrides can be reset by passing `null` as the value for either the `country` or `language` key to `set()`.

**Resetting locale:**


```js
const sdk = await UA
await sdk.locale.set({country: null, language: 'fr'})
```


You may also retrieve the current resolved locale; this will coalesce the values provided by the browser with the current override values that you have set:

**Getting the current locale settings:**


```js
const sdk = await UA
const {language, country} = await sdk.locale.get()
```


> **Note:** Not all browser and OS combinations will provide a country, so the value of `country` may be `null`.

