---
title: Locale
description: BCP 47 language tag type for i18n registry and provider APIs
---
import DocsLink from '@/components/docs/DocsLink.astro';
`Locale` is the BCP 47 tag type used by `registerI18n`, providers, and `Translator`. Shipped packs autocomplete as `BuiltInLocale`; any other tag remains valid at runtime.
## Import
```ts
import type { Locale } from '@videojs/html/i18n';
// or @videojs/react/i18n
```
## Definition
```ts
type Locale = BuiltInLocale | (string & {});
```
The `(string & {})` pattern keeps custom tags (`'xx'`, `'en-US'`) type-safe without losing autocomplete for built-ins.
## Resolution
Providers and `getI18nTranslations` normalize tags and walk the parent chain (`es-MX` → `es` → `en`) via `findLocaleKeys`. See Internationalization for explicit vs ambient resolution.
## Examples
```ts
const es: Locale = 'es';
const custom: Locale = 'en-US';
const regional: Locale = 'pt-BR';
```
## Related
- `BuiltInLocale`
- `registerI18n`
- Switch locale dynamically