# LocaleResolver

Learn about the function that resolves the preferred locale.

This type describes the function the SDK uses to resolve the preferred locale for a request.

Provide one through the [`localeResolver`](/reference/sdk/nuxt/api/configuration#localeresolver-prop) option to localize content based on the URL, subdomain, headers, or cookies.

## Definition

This type has the following shape:

```ts
type LocaleResolver = (event: H3Event) => Promise<string | null> | string | null;
```

The function receives the [H3 event](https://h3.unjs.io/guide/event) and returns the locale, or `null` to use the default. It may be synchronous or asynchronous.
