mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
docs: clarify createI18n shared context
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: createI18n
|
||||
description: Factory that creates an isolated React i18n context stack with I18nProvider and hooks
|
||||
description: Factory that creates a React i18n provider with custom loading options
|
||||
---
|
||||
|
||||
import UtilReference from "@/components/docs/api-reference/UtilReference.astro";
|
||||
@@ -9,7 +9,7 @@ import FrameworkCase from "@/components/docs/FrameworkCase.astro";
|
||||
|
||||
<FrameworkCase frameworks={["react"]}>
|
||||
|
||||
`createI18n` mirrors <DocsLink slug="reference/create-player">`createPlayer`</DocsLink>: it returns a dedicated `I18nProvider`, `useTranslator`, and `useLocale` for apps that need an isolated i18n stack. Most apps import the default exports from `@videojs/react/i18n` instead.
|
||||
`createI18n` returns an `I18nProvider`, `useTranslator`, and `useLocale` wired to the shared React i18n context used by the stock skins and controls. Use it when you need options such as a custom locale loader. Most apps import the default exports from `@videojs/react/i18n` instead.
|
||||
|
||||
```tsx
|
||||
import { createI18n } from '@videojs/react/i18n';
|
||||
|
||||
Reference in New Issue
Block a user