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

# Function: createLocaleSet()

> **createLocaleSet**<`K`>(`bundles`): [`LocaleSet`](../interfaces/LocaleSet.md)<`K`>

Alpha

Define the locale subset your app supports. Pass the imported bundle objects as an object
whose keys are the locale tags (JavaScript shorthand makes this natural). TypeScript narrows
the accepted locale tags to only the keys you provide.

Not calling `createLocaleSet` at all gives the full 44-locale barrel — use this factory only
when you need compile-time validation or explicit tree-shaking signals.

## Type Parameters

### K

`K` *extends* `string`

## Parameters

### bundles

`Record`<`K`, [`LocaleBundle`](../interfaces/LocaleBundle.md)>

## Returns

[`LocaleSet`](../interfaces/LocaleSet.md)<`K`>

## Example

```ts
import { createLocaleSet, en, hu, de } from "@pantoken/web-components";

const locales = createLocaleSet({ en, hu, de });

locales.register("hu");          // ✓ type-safe
locales.register("fr");          // TypeScript error — not in this set
locales.has("hu");               // → true (type guard)
locales.get("hu");               // → LocaleBundle
```
