# getI18nTranslations

Read the merged translation map for a locale using BCP 47 parent-chain fallback

## Import

```ts
import { getI18nTranslations } from "@videojs/html/i18n";
```

`getI18nTranslations` walks the BCP 47 lookup chain (`es-MX` → `es` → `en`) and merges registry layers into one map. Providers combine this map with lazy-loaded built-in packs and provider overrides. Call it directly when building custom UI outside built-in controls.

See [Internationalize the player](https://videojs.org/docs/framework/html/guides/internationalization) for merge order and fallback rules.

```ts
import { createTranslator, getI18nTranslations } from '@videojs/html/i18n';

const t = createTranslator(getI18nTranslations('pt-BR'), 'pt-BR');
t('buttons.play', { default: 'Play' });
```

## API Reference

`getI18nTranslations(locale): FlatTranslations`

### Parameters

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `locale` (required) | `(typeof LOCALES)[number] \| string & {}` | — | BCP 47 tag to resolve (e.g. `es-MX`, `zh-Hant-HK`). |

### Return Value

| Type |
| --- |
| `{ [Key in TranslationKey]?: TranslationParams[Key] extends never ? string : Key extends keyof ParametricTranslations ? ParametricTranslations[Key] : string; } & Record<string, string \| undefined>` |

---

HTML documentation: https://videojs.org/docs/framework/html/llms.txt
All documentation: https://videojs.org/llms.txt
