@@ -4,7 +4,7 @@ This folder contains React components and hooks for the Lingo.dev translation ru
44
55## Components
66
7- ### ` <TranslationProvider > `
7+ ### ` <LingoProvider > `
88
99Context provider that manages translations and locale switching for your entire app.
1010
@@ -19,13 +19,13 @@ Context provider that manages translations and locale switching for your entire
1919
2020``` tsx
2121// app/layout.tsx
22- import { TranslationProvider } from " @lingo.dev/compiler-beta/react" ;
22+ import { LingoProvider } from " @lingo.dev/compiler-beta/react" ;
2323
2424export default function RootLayout({ children }) {
2525 return (
2626 <html >
2727 <body >
28- <TranslationProvider initialLocale = " en" >{ children } </TranslationProvider >
28+ <LingoProvider initialLocale = " en" >{ children } </LingoProvider >
2929 </body >
3030 </html >
3131 );
@@ -157,7 +157,7 @@ For Server Components, use the separate `getServerTranslations()` function (not
157157
158158```
159159┌─────────────────────────────────────┐
160- │ TranslationProvider │
160+ │ LingoProvider │
161161│ (Context + State Management) │
162162└────────────┬────────────────────────┘
163163 │
@@ -180,7 +180,7 @@ For Server Components, use the separate `getServerTranslations()` function (not
180180
181181## Best Practices
182182
183- 1 . ** Wrap your entire app** with ` <TranslationProvider > ` in the root layout
183+ 1 . ** Wrap your entire app** with ` <LingoProvider > ` in the root layout
1841842 . ** Pass the router** to ` <LocaleSwitcher> ` for seamless Server Component updates
1851853 . ** Pre-load common translations** using ` initialTranslations ` prop
1861864 . ** Use custom fetch function** if you have a custom translation API
@@ -191,7 +191,7 @@ All components and hooks are fully typed with TypeScript. Import types as needed
191191
192192``` tsx
193193import type {
194- TranslationProviderProps ,
194+ LingoProviderProps ,
195195 LocaleSwitcherProps ,
196196 LocaleConfig ,
197197 TranslationFunction ,
@@ -204,16 +204,16 @@ import type {
204204When testing components that use translations:
205205
206206``` tsx
207- import { TranslationProvider } from " @lingo.dev/compiler-beta/react" ;
207+ import { LingoProvider } from " @lingo.dev/compiler-beta/react" ;
208208
209209test (" my component" , () => {
210210 render (
211- <TranslationProvider
211+ <LingoProvider
212212 initialLocale = " en"
213213 fetchTranslations = { async () => ({ hash_abc: " Hello" })}
214214 >
215215 <MyComponent />
216- </TranslationProvider >,
216+ </LingoProvider >,
217217 );
218218});
219219```
0 commit comments