@intlayer/docs 6.1.6-canary.0 → 6.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +71 -80
  2. package/dist/cjs/generated/docs.entry.cjs +16 -0
  3. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  4. package/dist/esm/generated/docs.entry.mjs +16 -0
  5. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  6. package/dist/types/generated/docs.entry.d.ts +1 -0
  7. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  8. package/docs/ar/intlayer_with_angular.md +2 -2
  9. package/docs/ar/intlayer_with_astro.md +246 -0
  10. package/docs/ar/intlayer_with_create_react_app.md +3 -2
  11. package/docs/ar/intlayer_with_express.md +2 -2
  12. package/docs/ar/intlayer_with_nestjs.md +2 -2
  13. package/docs/ar/intlayer_with_nextjs_14.md +2 -2
  14. package/docs/ar/intlayer_with_nextjs_15.md +2 -2
  15. package/docs/ar/intlayer_with_nextjs_page_router.md +2 -2
  16. package/docs/ar/intlayer_with_nuxt.md +2 -2
  17. package/docs/ar/intlayer_with_react_native+expo.md +11 -20
  18. package/docs/ar/intlayer_with_react_router_v7.md +195 -241
  19. package/docs/ar/intlayer_with_tanstack.md +198 -272
  20. package/docs/ar/intlayer_with_vite+preact.md +9 -9
  21. package/docs/ar/intlayer_with_vite+react.md +7 -7
  22. package/docs/ar/intlayer_with_vite+vue.md +9 -9
  23. package/docs/de/intlayer_with_angular.md +2 -2
  24. package/docs/de/intlayer_with_astro.md +246 -0
  25. package/docs/de/intlayer_with_create_react_app.md +2 -2
  26. package/docs/de/intlayer_with_express.md +2 -2
  27. package/docs/de/intlayer_with_nestjs.md +2 -2
  28. package/docs/de/intlayer_with_nextjs_14.md +2 -2
  29. package/docs/de/intlayer_with_nextjs_15.md +2 -2
  30. package/docs/de/intlayer_with_nextjs_page_router.md +2 -2
  31. package/docs/de/intlayer_with_nuxt.md +2 -2
  32. package/docs/de/intlayer_with_react_native+expo.md +11 -20
  33. package/docs/de/intlayer_with_react_router_v7.md +193 -242
  34. package/docs/de/intlayer_with_tanstack.md +194 -266
  35. package/docs/de/intlayer_with_vite+preact.md +9 -9
  36. package/docs/de/intlayer_with_vite+react.md +9 -9
  37. package/docs/de/intlayer_with_vite+vue.md +11 -11
  38. package/docs/de/packages/vite-intlayer/index.md +3 -3
  39. package/docs/en/how_works_intlayer.md +1 -1
  40. package/docs/en/index.md +1 -1
  41. package/docs/en/intlayer_cli.md +1 -1
  42. package/docs/en/intlayer_with_angular.md +4 -4
  43. package/docs/en/intlayer_with_astro.md +246 -0
  44. package/docs/en/intlayer_with_create_react_app.md +4 -4
  45. package/docs/en/intlayer_with_express.md +3 -3
  46. package/docs/en/intlayer_with_lynx+react.md +1 -1
  47. package/docs/en/intlayer_with_nestjs.md +2 -2
  48. package/docs/en/intlayer_with_nextjs_14.md +13 -4
  49. package/docs/en/intlayer_with_nextjs_15.md +13 -4
  50. package/docs/en/intlayer_with_nextjs_page_router.md +5 -5
  51. package/docs/en/intlayer_with_nuxt.md +4 -4
  52. package/docs/en/intlayer_with_react_native+expo.md +46 -24
  53. package/docs/en/intlayer_with_react_router_v7.md +164 -211
  54. package/docs/en/intlayer_with_tanstack.md +166 -241
  55. package/docs/en/intlayer_with_vite+preact.md +12 -12
  56. package/docs/en/intlayer_with_vite+react.md +12 -12
  57. package/docs/en/intlayer_with_vite+solid.md +2 -2
  58. package/docs/en/intlayer_with_vite+svelte.md +2 -2
  59. package/docs/en/intlayer_with_vite+vue.md +12 -12
  60. package/docs/en/introduction.md +1 -1
  61. package/docs/en/packages/next-intlayer/useDictionary.md +1 -1
  62. package/docs/en/packages/next-intlayer/useIntlayer.md +1 -1
  63. package/docs/en/packages/react-intlayer/useDictionary.md +1 -1
  64. package/docs/en/packages/react-intlayer/useI18n.md +1 -1
  65. package/docs/en/packages/react-intlayer/useIntlayer.md +1 -1
  66. package/docs/en/releases/v6.md +1 -0
  67. package/docs/en/roadmap.md +1 -1
  68. package/docs/en-GB/intlayer_with_angular.md +3 -3
  69. package/docs/en-GB/intlayer_with_astro.md +246 -0
  70. package/docs/en-GB/intlayer_with_create_react_app.md +5 -4
  71. package/docs/en-GB/intlayer_with_express.md +2 -2
  72. package/docs/en-GB/intlayer_with_nestjs.md +2 -2
  73. package/docs/en-GB/intlayer_with_nextjs_14.md +4 -4
  74. package/docs/en-GB/intlayer_with_nextjs_15.md +2 -2
  75. package/docs/en-GB/intlayer_with_nextjs_page_router.md +2 -2
  76. package/docs/en-GB/intlayer_with_nuxt.md +2 -2
  77. package/docs/en-GB/intlayer_with_react_native+expo.md +11 -20
  78. package/docs/en-GB/intlayer_with_react_router_v7.md +171 -220
  79. package/docs/en-GB/intlayer_with_tanstack.md +174 -248
  80. package/docs/en-GB/intlayer_with_vite+preact.md +9 -9
  81. package/docs/en-GB/intlayer_with_vite+react.md +9 -9
  82. package/docs/en-GB/intlayer_with_vite+vue.md +11 -11
  83. package/docs/en-GB/packages/next-intlayer/useIntlayer.md +1 -1
  84. package/docs/en-GB/packages/react-intlayer/useIntlayer.md +1 -1
  85. package/docs/es/intlayer_with_angular.md +2 -2
  86. package/docs/es/intlayer_with_astro.md +246 -0
  87. package/docs/es/intlayer_with_create_react_app.md +3 -2
  88. package/docs/es/intlayer_with_express.md +2 -2
  89. package/docs/es/intlayer_with_nextjs_14.md +2 -2
  90. package/docs/es/intlayer_with_nextjs_15.md +2 -2
  91. package/docs/es/intlayer_with_react_native+expo.md +11 -20
  92. package/docs/es/intlayer_with_react_router_v7.md +188 -232
  93. package/docs/es/intlayer_with_tanstack.md +203 -273
  94. package/docs/es/intlayer_with_vite+preact.md +7 -7
  95. package/docs/es/intlayer_with_vite+react.md +7 -7
  96. package/docs/es/intlayer_with_vite+vue.md +9 -9
  97. package/docs/fr/intlayer_with_angular.md +2 -2
  98. package/docs/fr/intlayer_with_astro.md +246 -0
  99. package/docs/fr/intlayer_with_create_react_app.md +3 -2
  100. package/docs/fr/intlayer_with_express.md +2 -2
  101. package/docs/fr/intlayer_with_nestjs.md +2 -2
  102. package/docs/fr/intlayer_with_nextjs_14.md +2 -2
  103. package/docs/fr/intlayer_with_react_native+expo.md +11 -20
  104. package/docs/fr/intlayer_with_react_router_v7.md +188 -248
  105. package/docs/fr/intlayer_with_tanstack.md +192 -265
  106. package/docs/fr/intlayer_with_vite+preact.md +7 -7
  107. package/docs/fr/intlayer_with_vite+react.md +7 -7
  108. package/docs/fr/intlayer_with_vite+vue.md +9 -9
  109. package/docs/hi/intlayer_cli.md +1 -4
  110. package/docs/hi/intlayer_with_angular.md +2 -2
  111. package/docs/hi/intlayer_with_astro.md +246 -0
  112. package/docs/hi/intlayer_with_create_react_app.md +2 -2
  113. package/docs/hi/intlayer_with_express.md +2 -2
  114. package/docs/hi/intlayer_with_nestjs.md +2 -2
  115. package/docs/hi/intlayer_with_nextjs_14.md +2 -2
  116. package/docs/hi/intlayer_with_nextjs_15.md +2 -2
  117. package/docs/hi/intlayer_with_nextjs_page_router.md +2 -2
  118. package/docs/hi/intlayer_with_nuxt.md +2 -2
  119. package/docs/hi/intlayer_with_react_native+expo.md +11 -20
  120. package/docs/hi/intlayer_with_react_router_v7.md +199 -243
  121. package/docs/hi/intlayer_with_tanstack.md +210 -285
  122. package/docs/hi/intlayer_with_vite+preact.md +9 -9
  123. package/docs/hi/intlayer_with_vite+react.md +9 -9
  124. package/docs/hi/intlayer_with_vite+solid.md +1 -1
  125. package/docs/hi/intlayer_with_vite+vue.md +11 -11
  126. package/docs/it/intlayer_with_angular.md +2 -2
  127. package/docs/it/intlayer_with_astro.md +246 -0
  128. package/docs/it/intlayer_with_create_react_app.md +3 -2
  129. package/docs/it/intlayer_with_express.md +2 -2
  130. package/docs/it/intlayer_with_nestjs.md +2 -2
  131. package/docs/it/intlayer_with_nextjs_14.md +2 -2
  132. package/docs/it/intlayer_with_nextjs_15.md +2 -2
  133. package/docs/it/intlayer_with_nextjs_page_router.md +2 -2
  134. package/docs/it/intlayer_with_nuxt.md +2 -2
  135. package/docs/it/intlayer_with_react_native+expo.md +11 -21
  136. package/docs/it/intlayer_with_react_router_v7.md +195 -242
  137. package/docs/it/intlayer_with_tanstack.md +203 -267
  138. package/docs/it/intlayer_with_vite+preact.md +9 -9
  139. package/docs/it/intlayer_with_vite+react.md +13 -11
  140. package/docs/it/intlayer_with_vite+vue.md +11 -11
  141. package/docs/ja/intlayer_with_angular.md +2 -2
  142. package/docs/ja/intlayer_with_astro.md +246 -0
  143. package/docs/ja/intlayer_with_create_react_app.md +3 -2
  144. package/docs/ja/intlayer_with_express.md +2 -2
  145. package/docs/ja/intlayer_with_nestjs.md +2 -2
  146. package/docs/ja/intlayer_with_nextjs_14.md +2 -2
  147. package/docs/ja/intlayer_with_nextjs_15.md +2 -2
  148. package/docs/ja/intlayer_with_nextjs_page_router.md +2 -2
  149. package/docs/ja/intlayer_with_nuxt.md +2 -2
  150. package/docs/ja/intlayer_with_react_native+expo.md +18 -29
  151. package/docs/ja/intlayer_with_react_router_v7.md +204 -250
  152. package/docs/ja/intlayer_with_tanstack.md +218 -286
  153. package/docs/ja/intlayer_with_vite+preact.md +9 -9
  154. package/docs/ja/intlayer_with_vite+react.md +11 -11
  155. package/docs/ja/intlayer_with_vite+vue.md +11 -11
  156. package/docs/ko/intlayer_with_angular.md +2 -2
  157. package/docs/ko/intlayer_with_astro.md +246 -0
  158. package/docs/ko/intlayer_with_create_react_app.md +3 -2
  159. package/docs/ko/intlayer_with_express.md +2 -2
  160. package/docs/ko/intlayer_with_nestjs.md +2 -2
  161. package/docs/ko/intlayer_with_nextjs_14.md +2 -2
  162. package/docs/ko/intlayer_with_nextjs_15.md +2 -2
  163. package/docs/ko/intlayer_with_nextjs_page_router.md +2 -2
  164. package/docs/ko/intlayer_with_nuxt.md +2 -2
  165. package/docs/ko/intlayer_with_react_native+expo.md +19 -28
  166. package/docs/ko/intlayer_with_react_router_v7.md +190 -244
  167. package/docs/ko/intlayer_with_tanstack.md +200 -270
  168. package/docs/ko/intlayer_with_vite+preact.md +9 -9
  169. package/docs/ko/intlayer_with_vite+react.md +9 -9
  170. package/docs/ko/intlayer_with_vite+vue.md +11 -11
  171. package/docs/pt/intlayer_with_angular.md +2 -2
  172. package/docs/pt/intlayer_with_astro.md +246 -0
  173. package/docs/pt/intlayer_with_create_react_app.md +3 -2
  174. package/docs/pt/intlayer_with_express.md +2 -2
  175. package/docs/pt/intlayer_with_nestjs.md +2 -2
  176. package/docs/pt/intlayer_with_nextjs_14.md +2 -2
  177. package/docs/pt/intlayer_with_nextjs_15.md +2 -2
  178. package/docs/pt/intlayer_with_nextjs_page_router.md +2 -2
  179. package/docs/pt/intlayer_with_nuxt.md +2 -2
  180. package/docs/pt/intlayer_with_react_native+expo.md +11 -20
  181. package/docs/pt/intlayer_with_react_router_v7.md +7 -13
  182. package/docs/pt/intlayer_with_tanstack.md +183 -258
  183. package/docs/pt/intlayer_with_vite+preact.md +9 -9
  184. package/docs/pt/intlayer_with_vite+react.md +9 -9
  185. package/docs/pt/intlayer_with_vite+vue.md +9 -9
  186. package/docs/ru/intlayer_with_angular.md +2 -2
  187. package/docs/ru/intlayer_with_astro.md +246 -0
  188. package/docs/ru/intlayer_with_create_react_app.md +3 -2
  189. package/docs/ru/intlayer_with_express.md +2 -2
  190. package/docs/ru/intlayer_with_nestjs.md +2 -2
  191. package/docs/ru/intlayer_with_nextjs_14.md +2 -2
  192. package/docs/ru/intlayer_with_nextjs_15.md +2 -2
  193. package/docs/ru/intlayer_with_nextjs_page_router.md +2 -2
  194. package/docs/ru/intlayer_with_nuxt.md +2 -2
  195. package/docs/ru/intlayer_with_react_native+expo.md +11 -20
  196. package/docs/ru/intlayer_with_react_router_v7.md +192 -238
  197. package/docs/ru/intlayer_with_tanstack.md +197 -269
  198. package/docs/ru/intlayer_with_vite+preact.md +9 -9
  199. package/docs/ru/intlayer_with_vite+react.md +9 -9
  200. package/docs/ru/intlayer_with_vite+vue.md +11 -11
  201. package/docs/tr/how_works_intlayer.md +1 -1
  202. package/docs/tr/index.md +1 -1
  203. package/docs/tr/intlayer_cli.md +1 -1
  204. package/docs/tr/intlayer_with_angular.md +4 -4
  205. package/docs/tr/intlayer_with_astro.md +246 -0
  206. package/docs/tr/intlayer_with_create_react_app.md +4 -4
  207. package/docs/tr/intlayer_with_express.md +3 -3
  208. package/docs/tr/intlayer_with_lynx+react.md +1 -1
  209. package/docs/tr/intlayer_with_nestjs.md +2 -2
  210. package/docs/tr/intlayer_with_nextjs_14.md +2 -2
  211. package/docs/tr/intlayer_with_nextjs_15.md +4 -4
  212. package/docs/tr/intlayer_with_nextjs_page_router.md +5 -5
  213. package/docs/tr/intlayer_with_nuxt.md +4 -4
  214. package/docs/tr/intlayer_with_react_native+expo.md +12 -21
  215. package/docs/tr/intlayer_with_react_router_v7.md +222 -267
  216. package/docs/tr/intlayer_with_tanstack.md +400 -303
  217. package/docs/tr/intlayer_with_vite+preact.md +12 -12
  218. package/docs/tr/intlayer_with_vite+react.md +12 -12
  219. package/docs/tr/intlayer_with_vite+solid.md +2 -2
  220. package/docs/tr/intlayer_with_vite+svelte.md +2 -2
  221. package/docs/tr/intlayer_with_vite+vue.md +12 -12
  222. package/docs/tr/introduction.md +1 -1
  223. package/docs/tr/packages/react-intlayer/useDictionary.md +1 -1
  224. package/docs/tr/packages/react-intlayer/useI18n.md +1 -1
  225. package/docs/tr/roadmap.md +1 -1
  226. package/docs/zh/intlayer_with_angular.md +2 -2
  227. package/docs/zh/intlayer_with_astro.md +246 -0
  228. package/docs/zh/intlayer_with_create_react_app.md +3 -2
  229. package/docs/zh/intlayer_with_express.md +2 -2
  230. package/docs/zh/intlayer_with_nestjs.md +2 -2
  231. package/docs/zh/intlayer_with_nextjs_14.md +2 -2
  232. package/docs/zh/intlayer_with_nextjs_15.md +2 -2
  233. package/docs/zh/intlayer_with_nextjs_page_router.md +2 -2
  234. package/docs/zh/intlayer_with_nuxt.md +2 -2
  235. package/docs/zh/intlayer_with_react_native+expo.md +19 -28
  236. package/docs/zh/intlayer_with_react_router_v7.md +200 -248
  237. package/docs/zh/intlayer_with_tanstack.md +208 -283
  238. package/docs/zh/intlayer_with_vite+preact.md +9 -9
  239. package/docs/zh/intlayer_with_vite+react.md +9 -9
  240. package/docs/zh/intlayer_with_vite+vue.md +9 -9
  241. package/package.json +11 -11
  242. package/src/generated/docs.entry.ts +16 -0
@@ -1483,9 +1483,9 @@ yarn add @intlayer/swc --save-dev
1483
1483
 
1484
1484
  Intlayer 使用模块增强来利用 TypeScript 的优势,使您的代码库更健壮。
1485
1485
 
1486
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1486
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1487
1487
 
1488
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1488
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1489
1489
 
1490
1490
  确保您的 TypeScript 配置包含自动生成的类型。
1491
1491
 
@@ -1425,9 +1425,9 @@ yarn add @intlayer/swc --save-dev
1425
1425
 
1426
1426
  Intlayer 使用模块增强(module augmentation)来利用 TypeScript 的优势,使您的代码库更健壮。
1427
1427
 
1428
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
1428
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
1429
1429
 
1430
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
1430
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
1431
1431
 
1432
1432
  确保您的 TypeScript 配置包含自动生成的类型。
1433
1433
 
@@ -785,9 +785,9 @@ module.exports = aboutMetaContent;
785
785
 
786
786
  Intlayer 使用模块增强来利用 TypeScript 的优势,使您的代码库更加强大。
787
787
 
788
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png)
788
+ ![Autocompletion](https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true)
789
789
 
790
- ![alt text](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png)
790
+ ![Translation error](https://github.com/aymericzip/intlayer/blob/main/docs/assets/translation_error.png?raw=true)
791
791
 
792
792
  确保您的 TypeScript 配置包含自动生成的类型。
793
793
 
@@ -148,24 +148,23 @@ module.exports = (async () => {
148
148
 
149
149
  ## 第4步:添加 Intlayer 提供者
150
150
 
151
- 为了在整个应用程序中保持用户语言的同步,您需要使用 `react-intlayer` 中的 `IntlayerProvider` 组件包裹您的根组件。
151
+ 为了在您的应用程序中保持用户语言的同步,您需要使用来自 `react-intlayer-native` `IntlayerProvider` 组件包裹您的根组件。
152
152
 
153
- 此外,您还需要在 `index.js` 文件中添加 `intlayerPolyfill` 函数,以确保 Intlayer 能够正常工作。
153
+ > 请确保使用来自 `react-native-intlayer` 而不是 `react-intlayer` 的提供者。来自 `react-native-intlayer` 的导出包含了 web API 的 polyfills。
154
154
 
155
155
  ````tsx fileName="app/_layout.tsx" codeFormat="typescript"
156
156
  import { Stack } from "expo-router";
157
157
  import { getLocales } from "expo-localization";
158
- import { IntlayerProviderContent } from "react-intlayer";
159
- import { intlayerPolyfill } from "react-native-intlayer";
158
+ import { IntlayerProvider } from "react-native-intlayer";
160
159
  import { type FC } from "react";
161
160
 
162
- intlayerPolyfill();
161
+
163
162
 
164
163
  const getDeviceLocale = () => getLocales()[0]?.languageTag;
165
164
 
166
165
  const RootLayout: FC = () => {
167
166
  return (
168
- <IntlayerProviderContent defaultLocale={getDeviceLocale()}>
167
+ <IntlayerProvider defaultLocale={getDeviceLocale()}>
169
168
  <Stack>
170
169
  为了在您的应用程序中保持用户语言的同步,您需要使用来自 `react-intlayer` 的 `IntlayerProvider` 组件包裹您的根组件。
171
170
 
@@ -174,21 +173,20 @@ const RootLayout: FC = () => {
174
173
  ```tsx fileName="app/_layout.tsx" codeFormat="typescript"
175
174
  import { Stack } from "expo-router";
176
175
  import { getLocales } from "expo-localization";
177
- import { IntlayerProviderContent } from "react-intlayer";
178
- import { intlayerPolyfill } from "react-native-intlayer";
176
+ import { IntlayerProvider } from "react-native-intlayer";
179
177
  import { type FC } from "react";
180
178
 
181
- intlayerPolyfill();
179
+
182
180
 
183
181
  const getDeviceLocale = () => getLocales()[0]?.languageTag;
184
182
 
185
183
  const RootLayout: FC = () => {
186
184
  return (
187
- <IntlayerProviderContent defaultLocale={getDeviceLocale()}>
185
+ <IntlayerProvider defaultLocale={getDeviceLocale()}>
188
186
  <Stack>
189
187
  <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
190
188
  </Stack>
191
- </IntlayerProviderContent>
189
+ </IntlayerProvider>
192
190
  );
193
191
  };
194
192
 
@@ -198,20 +196,17 @@ export default RootLayout;
198
196
  ```jsx fileName="app/_layout.mjx" codeFormat="esm"
199
197
  import { Stack } from "expo-router";
200
198
  import { getLocales } from "expo-localization";
201
- import { IntlayerProviderContent } from "react-intlayer";
202
- import { intlayerPolyfill } from "react-native-intlayer";
203
-
204
- intlayerPolyfill();
199
+ import { IntlayerProvider } from "react-native-intlayer";
205
200
 
206
201
  const getDeviceLocale = () => getLocales()[0]?.languageTag;
207
202
 
208
203
  const RootLayout = () => {
209
204
  return (
210
- <IntlayerProviderContent defaultLocale={getDeviceLocale()}>
205
+ <IntlayerProvider defaultLocale={getDeviceLocale()}>
211
206
  <Stack>
212
207
  <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
213
208
  </Stack>
214
- </IntlayerProviderContent>
209
+ </IntlayerProvider>
215
210
  );
216
211
  };
217
212
 
@@ -221,20 +216,17 @@ export default RootLayout;
221
216
  ```jsx fileName="app/_layout.cjx" codeFormat="commonjs"
222
217
  const { Stack } = require("expo-router");
223
218
  const { getLocales } = require("expo-localization");
224
- const { IntlayerProviderContent } = require("react-intlayer");
225
- const { intlayerPolyfill } = require("react-native-intlayer");
226
-
227
- intlayerPolyfill();
219
+ const { IntlayerProvider } = require("react-native-intlayer");
228
220
 
229
221
  const getDeviceLocale = () => getLocales()[0]?.languageTag;
230
222
 
231
223
  const RootLayout = () => {
232
224
  return (
233
- <IntlayerProviderContent defaultLocale={getDeviceLocale()}>
225
+ <IntlayerProvider defaultLocale={getDeviceLocale()}>
234
226
  <Stack>
235
227
  <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
236
228
  </Stack>
237
- </IntlayerProviderContent>
229
+ </IntlayerProvider>
238
230
  );
239
231
  };
240
232
 
@@ -248,21 +240,20 @@ module.exports = RootLayout;
248
240
  ```jsx fileName="app/_layout.cjx" codeFormat="commonjs"
249
241
  const { Stack } = require("expo-router");
250
242
  const { getLocales } = require("expo-localization");
251
- const { IntlayerProviderContent } = require("react-intlayer");
252
- const { intlayerPolyfill } = require("react-native-intlayer");
243
+ const { IntlayerProvider } = require("react-native-intlayer");
244
+
253
245
 
254
- intlayerPolyfill();
255
246
 
256
247
  // 获取设备的语言环境
257
248
  const getDeviceLocale = () => getLocales()[0]?.languageTag;
258
249
 
259
250
  const RootLayout = () => {
260
251
  return (
261
- <IntlayerProviderContent defaultLocale={getDeviceLocale()}>
252
+ <IntlayerProvider defaultLocale={getDeviceLocale()}>
262
253
  <Stack>
263
254
  <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
264
255
  </Stack>
265
- </IntlayerProviderContent>
256
+ </IntlayerProvider>
266
257
  );
267
258
  };
268
259