---
url: /api/renderers/web-components/src/interfaces/LocaleSet.md
---
[pantoken-root](../../../../index.md) / [renderers/web-components/src](../index.md) / LocaleSet

# Interface: LocaleSet\<K>

Alpha

A typed subset of [LocaleBundle](LocaleBundle.md)s. Created by [createLocaleSet](../functions/createLocaleSet.md) to constrain an
app's supported locales at compile time — registering or retrieving a locale not in the set is a
TypeScript error.

## Type Parameters

### K

`K` *extends* `string`

## Properties

### locales

> `readonly` **locales**: readonly `K`\[]

Alpha

The locale tags included in this set.

## Methods

### has()

> **has**(`locale`): `locale is K`

Alpha

Type guard — true when `locale` is in this set.

#### Parameters

##### locale

`string`

#### Returns

`locale is K`

***

### get()

> **get**(`locale`): [`LocaleBundle`](LocaleBundle.md)

Alpha

Return the bundle for `locale`. Throws at runtime when called with an unknown locale.

#### Parameters

##### locale

`K`

#### Returns

[`LocaleBundle`](LocaleBundle.md)

***

### register()

> **register**(`locale`, `target?`, `options?`): `void`

Alpha

Register `@pantoken/web-components` elements with the given locale from this set.

#### Parameters

##### locale

`K`

##### target?

[`ElementRegistry`](ElementRegistry.md)

##### options?

###### prefix?

`string` | `null`

###### only?

readonly `string`\[]

#### Returns

`void`
