# I18nProvider

React provider that resolves locale and supplies a typed translator to descendants

## Import

```tsx
import { I18nProvider } from "@videojs/react";
```

`I18nProvider` resolves the active locale, lazy-loads built-in packs, merges registry and provider layers, and exposes a translator through context. Wrap it around a player or custom controls that should translate.

Wrap custom controls or force a locale explicitly:

```tsx
import { I18nProvider } from '@videojs/react/i18n';

<I18nProvider locale="de" translations={{ buttons: { play: 'Abspielen' } }}>
  <MyControls />
</I18nProvider>
```

Omit `locale` to inherit the nearest `lang` attribute (via `langRootRef` or `<html lang>`). English is the fallback when no non-English locale is active or no translation layer supplies a string. See [Internationalize the player](https://videojs.org/docs/framework/react/guides/internationalization) for merge priority, browser translation fallback, and SSR guidance.

## API Reference

`I18nProvider(props): ReactNode`

### Parameters

| Parameter | Type | Default |
| --- | --- | --- |
| `props` (required) | `{ locale?: (typeof LOCALES)[number] \| string & {}; langRootRef?: RefObject<Element \| null>; translations?: Partial<Translations>; children: ReactNode; onActiveLocaleChange?: ((locale: Locale) => void) }` | — |

### Return Value

`ReactNode`

---

React documentation: https://videojs.org/docs/framework/react/llms.txt
All documentation: https://videojs.org/llms.txt
