@intlayer/docs 8.3.0-canary.4 → 8.3.1

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 (240) hide show
  1. package/docs/ar/compiler.md +84 -49
  2. package/docs/ar/configuration.md +80 -37
  3. package/docs/ar/intlayer_with_nextjs_16.md +174 -1
  4. package/docs/ar/intlayer_with_nextjs_compiler.md +174 -1
  5. package/docs/ar/intlayer_with_react_router_v7.md +224 -1
  6. package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +225 -1
  7. package/docs/ar/intlayer_with_svelte_kit.md +175 -2
  8. package/docs/ar/intlayer_with_tanstack.md +176 -1
  9. package/docs/ar/intlayer_with_vite+preact.md +174 -1
  10. package/docs/ar/intlayer_with_vite+react.md +174 -1
  11. package/docs/ar/intlayer_with_vite+solid.md +174 -1
  12. package/docs/ar/intlayer_with_vite+svelte.md +174 -1
  13. package/docs/ar/intlayer_with_vite+vue.md +174 -1
  14. package/docs/de/compiler.md +83 -48
  15. package/docs/de/configuration.md +434 -212
  16. package/docs/de/intlayer_with_nextjs_16.md +176 -1
  17. package/docs/de/intlayer_with_nextjs_compiler.md +106 -349
  18. package/docs/de/intlayer_with_react_router_v7.md +225 -2
  19. package/docs/de/intlayer_with_react_router_v7_fs_routes.md +221 -79
  20. package/docs/de/intlayer_with_svelte_kit.md +158 -2
  21. package/docs/de/intlayer_with_tanstack.md +159 -1
  22. package/docs/de/intlayer_with_vite+preact.md +157 -1
  23. package/docs/de/intlayer_with_vite+react.md +157 -1
  24. package/docs/de/intlayer_with_vite+solid.md +159 -3
  25. package/docs/de/intlayer_with_vite+svelte.md +157 -1
  26. package/docs/de/intlayer_with_vite+vue.md +157 -1
  27. package/docs/en/compiler.md +60 -33
  28. package/docs/en/configuration.md +80 -57
  29. package/docs/en/intlayer_with_nextjs_16.md +176 -0
  30. package/docs/en/intlayer_with_nextjs_compiler.md +179 -1
  31. package/docs/en/intlayer_with_react_router_v7.md +159 -0
  32. package/docs/en/intlayer_with_react_router_v7_fs_routes.md +159 -0
  33. package/docs/en/intlayer_with_svelte_kit.md +159 -0
  34. package/docs/en/intlayer_with_tanstack.md +160 -1
  35. package/docs/en/intlayer_with_vite+preact.md +159 -0
  36. package/docs/en/intlayer_with_vite+react.md +159 -0
  37. package/docs/en/intlayer_with_vite+solid.md +148 -27
  38. package/docs/en/intlayer_with_vite+svelte.md +159 -0
  39. package/docs/en/intlayer_with_vite+vue.md +142 -41
  40. package/docs/en-GB/compiler.md +66 -34
  41. package/docs/en-GB/configuration.md +78 -36
  42. package/docs/es/compiler.md +83 -48
  43. package/docs/es/configuration.md +429 -206
  44. package/docs/es/intlayer_with_adonisjs.md +1 -1
  45. package/docs/es/intlayer_with_express.md +1 -1
  46. package/docs/es/intlayer_with_fastify.md +1 -1
  47. package/docs/es/intlayer_with_hono.md +1 -1
  48. package/docs/es/intlayer_with_nestjs.md +1 -1
  49. package/docs/es/intlayer_with_nextjs_16.md +176 -3
  50. package/docs/es/intlayer_with_nextjs_compiler.md +175 -2
  51. package/docs/es/intlayer_with_nuxt.md +1 -1
  52. package/docs/es/intlayer_with_react_router_v7.md +227 -4
  53. package/docs/es/intlayer_with_react_router_v7_fs_routes.md +162 -4
  54. package/docs/es/intlayer_with_svelte_kit.md +158 -2
  55. package/docs/es/intlayer_with_tanstack.md +160 -2
  56. package/docs/es/intlayer_with_vite+preact.md +162 -6
  57. package/docs/es/intlayer_with_vite+react.md +160 -4
  58. package/docs/es/intlayer_with_vite+solid.md +163 -7
  59. package/docs/es/intlayer_with_vite+svelte.md +157 -1
  60. package/docs/es/intlayer_with_vite+vue.md +165 -9
  61. package/docs/fr/compiler.md +81 -46
  62. package/docs/fr/configuration.md +355 -134
  63. package/docs/fr/intlayer_with_adonisjs.md +1 -1
  64. package/docs/fr/intlayer_with_express.md +1 -1
  65. package/docs/fr/intlayer_with_fastify.md +1 -1
  66. package/docs/fr/intlayer_with_hono.md +1 -1
  67. package/docs/fr/intlayer_with_nestjs.md +1 -1
  68. package/docs/fr/intlayer_with_nextjs_16.md +183 -7
  69. package/docs/fr/intlayer_with_nextjs_compiler.md +179 -3
  70. package/docs/fr/intlayer_with_react_router_v7.md +229 -3
  71. package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +237 -6
  72. package/docs/fr/intlayer_with_svelte_kit.md +158 -2
  73. package/docs/fr/intlayer_with_tanstack.md +159 -1
  74. package/docs/fr/intlayer_with_vite+preact.md +164 -8
  75. package/docs/fr/intlayer_with_vite+react.md +162 -6
  76. package/docs/fr/intlayer_with_vite+solid.md +163 -7
  77. package/docs/fr/intlayer_with_vite+svelte.md +157 -1
  78. package/docs/fr/intlayer_with_vite+vue.md +164 -8
  79. package/docs/hi/compiler.md +81 -46
  80. package/docs/hi/configuration.md +87 -44
  81. package/docs/hi/intlayer_with_nextjs_16.md +174 -1
  82. package/docs/hi/intlayer_with_nextjs_compiler.md +174 -1
  83. package/docs/hi/intlayer_with_react_router_v7.md +224 -1
  84. package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +225 -1
  85. package/docs/hi/intlayer_with_svelte_kit.md +158 -2
  86. package/docs/hi/intlayer_with_tanstack.md +159 -1
  87. package/docs/hi/intlayer_with_vite+preact.md +157 -1
  88. package/docs/hi/intlayer_with_vite+react.md +157 -1
  89. package/docs/hi/intlayer_with_vite+solid.md +157 -1
  90. package/docs/hi/intlayer_with_vite+svelte.md +157 -1
  91. package/docs/hi/intlayer_with_vite+vue.md +157 -1
  92. package/docs/id/compiler.md +84 -51
  93. package/docs/id/configuration.md +83 -45
  94. package/docs/id/intlayer_with_nextjs_16.md +174 -1
  95. package/docs/id/intlayer_with_nextjs_compiler.md +174 -1
  96. package/docs/id/intlayer_with_react_router_v7.md +224 -1
  97. package/docs/id/intlayer_with_react_router_v7_fs_routes.md +225 -1
  98. package/docs/id/intlayer_with_svelte_kit.md +158 -2
  99. package/docs/id/intlayer_with_tanstack.md +159 -1
  100. package/docs/id/intlayer_with_vite+preact.md +157 -1
  101. package/docs/id/intlayer_with_vite+react.md +157 -1
  102. package/docs/id/intlayer_with_vite+solid.md +157 -1
  103. package/docs/id/intlayer_with_vite+svelte.md +157 -1
  104. package/docs/id/intlayer_with_vite+vue.md +157 -1
  105. package/docs/it/compiler.md +81 -46
  106. package/docs/it/configuration.md +426 -204
  107. package/docs/it/intlayer_with_nextjs_16.md +174 -1
  108. package/docs/it/intlayer_with_nextjs_compiler.md +174 -1
  109. package/docs/it/intlayer_with_react_router_v7.md +225 -2
  110. package/docs/it/intlayer_with_react_router_v7_fs_routes.md +226 -2
  111. package/docs/it/intlayer_with_svelte_kit.md +158 -2
  112. package/docs/it/intlayer_with_tanstack.md +159 -1
  113. package/docs/it/intlayer_with_vite+preact.md +157 -1
  114. package/docs/it/intlayer_with_vite+react.md +157 -1
  115. package/docs/it/intlayer_with_vite+solid.md +159 -3
  116. package/docs/it/intlayer_with_vite+svelte.md +157 -1
  117. package/docs/it/intlayer_with_vite+vue.md +157 -1
  118. package/docs/ja/compiler.md +94 -58
  119. package/docs/ja/configuration.md +88 -45
  120. package/docs/ja/intlayer_with_nextjs_16.md +174 -1
  121. package/docs/ja/intlayer_with_nextjs_compiler.md +174 -1
  122. package/docs/ja/intlayer_with_react_router_v7.md +184 -394
  123. package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +226 -2
  124. package/docs/ja/intlayer_with_svelte_kit.md +119 -595
  125. package/docs/ja/intlayer_with_tanstack.md +131 -642
  126. package/docs/ja/intlayer_with_vite+preact.md +111 -1231
  127. package/docs/ja/intlayer_with_vite+react.md +129 -1304
  128. package/docs/ja/intlayer_with_vite+solid.md +159 -3
  129. package/docs/ja/intlayer_with_vite+svelte.md +157 -1
  130. package/docs/ja/intlayer_with_vite+vue.md +157 -1
  131. package/docs/ko/compiler.md +88 -52
  132. package/docs/ko/configuration.md +87 -44
  133. package/docs/ko/intlayer_with_nextjs_16.md +174 -1
  134. package/docs/ko/intlayer_with_nextjs_compiler.md +174 -1
  135. package/docs/ko/intlayer_with_react_router_v7.md +225 -2
  136. package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +226 -2
  137. package/docs/ko/intlayer_with_svelte_kit.md +158 -2
  138. package/docs/ko/intlayer_with_tanstack.md +159 -1
  139. package/docs/ko/intlayer_with_vite+preact.md +157 -1
  140. package/docs/ko/intlayer_with_vite+react.md +157 -1
  141. package/docs/ko/intlayer_with_vite+solid.md +159 -3
  142. package/docs/ko/intlayer_with_vite+svelte.md +157 -1
  143. package/docs/ko/intlayer_with_vite+vue.md +157 -1
  144. package/docs/pl/compiler.md +84 -51
  145. package/docs/pl/configuration.md +83 -37
  146. package/docs/pl/intlayer_with_nextjs_16.md +174 -1
  147. package/docs/pl/intlayer_with_nextjs_compiler.md +174 -1
  148. package/docs/pl/intlayer_with_react_router_v7.md +224 -1
  149. package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +225 -1
  150. package/docs/pl/intlayer_with_svelte_kit.md +158 -2
  151. package/docs/pl/intlayer_with_tanstack.md +159 -1
  152. package/docs/pl/intlayer_with_vite+preact.md +157 -1
  153. package/docs/pl/intlayer_with_vite+react.md +157 -1
  154. package/docs/pl/intlayer_with_vite+solid.md +157 -1
  155. package/docs/pl/intlayer_with_vite+svelte.md +157 -1
  156. package/docs/pl/intlayer_with_vite+vue.md +157 -1
  157. package/docs/pt/compiler.md +81 -46
  158. package/docs/pt/configuration.md +404 -194
  159. package/docs/pt/intlayer_with_nextjs_16.md +174 -1
  160. package/docs/pt/intlayer_with_nextjs_compiler.md +174 -1
  161. package/docs/pt/intlayer_with_react_router_v7.md +224 -1
  162. package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +225 -1
  163. package/docs/pt/intlayer_with_svelte_kit.md +158 -2
  164. package/docs/pt/intlayer_with_tanstack.md +159 -1
  165. package/docs/pt/intlayer_with_vite+preact.md +157 -1
  166. package/docs/pt/intlayer_with_vite+react.md +157 -1
  167. package/docs/pt/intlayer_with_vite+solid.md +157 -1
  168. package/docs/pt/intlayer_with_vite+svelte.md +157 -1
  169. package/docs/pt/intlayer_with_vite+vue.md +157 -1
  170. package/docs/ru/compiler.md +90 -57
  171. package/docs/ru/configuration.md +76 -46
  172. package/docs/ru/intlayer_with_nextjs_16.md +174 -1
  173. package/docs/ru/intlayer_with_nextjs_compiler.md +174 -1
  174. package/docs/ru/intlayer_with_react_router_v7.md +224 -1
  175. package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +225 -1
  176. package/docs/ru/intlayer_with_svelte_kit.md +158 -2
  177. package/docs/ru/intlayer_with_tanstack.md +159 -1
  178. package/docs/ru/intlayer_with_vite+preact.md +157 -1
  179. package/docs/ru/intlayer_with_vite+react.md +157 -1
  180. package/docs/ru/intlayer_with_vite+solid.md +157 -1
  181. package/docs/ru/intlayer_with_vite+svelte.md +157 -1
  182. package/docs/ru/intlayer_with_vite+vue.md +157 -1
  183. package/docs/tr/compiler.md +85 -52
  184. package/docs/tr/configuration.md +83 -40
  185. package/docs/tr/intlayer_with_nextjs_16.md +174 -1
  186. package/docs/tr/intlayer_with_nextjs_compiler.md +174 -1
  187. package/docs/tr/intlayer_with_react_router_v7.md +224 -1
  188. package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +225 -1
  189. package/docs/tr/intlayer_with_svelte_kit.md +158 -2
  190. package/docs/tr/intlayer_with_tanstack.md +159 -1
  191. package/docs/tr/intlayer_with_vite+preact.md +157 -1
  192. package/docs/tr/intlayer_with_vite+react.md +157 -1
  193. package/docs/tr/intlayer_with_vite+solid.md +157 -1
  194. package/docs/tr/intlayer_with_vite+svelte.md +157 -1
  195. package/docs/tr/intlayer_with_vite+vue.md +157 -1
  196. package/docs/uk/compiler.md +96 -61
  197. package/docs/uk/configuration.md +83 -37
  198. package/docs/uk/intlayer_with_nextjs_16.md +174 -1
  199. package/docs/uk/intlayer_with_nextjs_compiler.md +174 -1
  200. package/docs/uk/intlayer_with_react_router_v7.md +224 -1
  201. package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +225 -1
  202. package/docs/uk/intlayer_with_svelte_kit.md +157 -1
  203. package/docs/uk/intlayer_with_tanstack.md +159 -1
  204. package/docs/uk/intlayer_with_vite+preact.md +157 -1
  205. package/docs/uk/intlayer_with_vite+react.md +157 -1
  206. package/docs/uk/intlayer_with_vite+solid.md +157 -1
  207. package/docs/uk/intlayer_with_vite+svelte.md +157 -1
  208. package/docs/uk/intlayer_with_vite+vue.md +157 -1
  209. package/docs/vi/compiler.md +85 -50
  210. package/docs/vi/configuration.md +85 -39
  211. package/docs/vi/intlayer_with_nextjs_16.md +174 -1
  212. package/docs/vi/intlayer_with_nextjs_compiler.md +174 -1
  213. package/docs/vi/intlayer_with_react_router_v7.md +224 -1
  214. package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +225 -1
  215. package/docs/vi/intlayer_with_svelte_kit.md +158 -2
  216. package/docs/vi/intlayer_with_tanstack.md +159 -1
  217. package/docs/vi/intlayer_with_vite+preact.md +157 -1
  218. package/docs/vi/intlayer_with_vite+react.md +157 -1
  219. package/docs/vi/intlayer_with_vite+solid.md +157 -1
  220. package/docs/vi/intlayer_with_vite+svelte.md +157 -1
  221. package/docs/vi/intlayer_with_vite+vue.md +157 -1
  222. package/docs/zh/compiler.md +84 -49
  223. package/docs/zh/configuration.md +80 -37
  224. package/docs/zh/intlayer_with_adonisjs.md +1 -1
  225. package/docs/zh/intlayer_with_express.md +1 -1
  226. package/docs/zh/intlayer_with_fastify.md +1 -1
  227. package/docs/zh/intlayer_with_hono.md +1 -1
  228. package/docs/zh/intlayer_with_nestjs.md +1 -1
  229. package/docs/zh/intlayer_with_nextjs_16.md +174 -1
  230. package/docs/zh/intlayer_with_nextjs_compiler.md +174 -1
  231. package/docs/zh/intlayer_with_react_router_v7.md +227 -4
  232. package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +228 -4
  233. package/docs/zh/intlayer_with_svelte_kit.md +158 -2
  234. package/docs/zh/intlayer_with_tanstack.md +159 -1
  235. package/docs/zh/intlayer_with_vite+preact.md +159 -3
  236. package/docs/zh/intlayer_with_vite+react.md +157 -1
  237. package/docs/zh/intlayer_with_vite+solid.md +161 -5
  238. package/docs/zh/intlayer_with_vite+svelte.md +157 -1
  239. package/docs/zh/intlayer_with_vite+vue.md +158 -2
  240. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-12-06
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: Next.js i18n - Como traduzir uma aplicação Next.js 16 em 2026
5
5
  description: Descubra como tornar seu site Next.js 16 multilíngue. Siga a documentação para internacionalizar (i18n) e traduzir.
6
6
  keywords:
@@ -1647,6 +1647,179 @@ Esta limitação ocorre porque o Turbopack não consegue executar plugins do web
1647
1647
 
1648
1648
  > Se estiver a usar next-intlayer@<=6.x.x, deve manter a flag `--turbopack` para que a aplicação Next.js 16 funcione corretamente com o Turbopack. Recomendamos usar next-intlayer@>=7.x.x para evitar esta limitação.
1649
1649
 
1650
+ ### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
1651
+
1652
+ Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
1653
+
1654
+ Para facilitar esse processo, o Intlayer propõe um [compilador](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/compiler.md) / [extrator](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/cli/extract.md) para transformar seus componentes e extrair o conteúdo.
1655
+
1656
+ Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
1657
+
1658
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
1659
+ import { type IntlayerConfig } from "intlayer";
1660
+
1661
+ const config: IntlayerConfig = {
1662
+ // ... Resto da sua configuração
1663
+ compiler: {
1664
+ /**
1665
+ * Indica se o compilador deve ser ativado.
1666
+ */
1667
+ enabled: true,
1668
+
1669
+ /**
1670
+ * Define o caminho dos arquivos de saída
1671
+ */
1672
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1673
+
1674
+ /**
1675
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
1676
+ */
1677
+ saveComponents: false,
1678
+
1679
+ /**
1680
+ * Prefixo da chave do dicionário
1681
+ */
1682
+ dictionaryKeyPrefix: "",
1683
+ },
1684
+ };
1685
+
1686
+ export default config;
1687
+ ```
1688
+
1689
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
1690
+ /** @type {import('intlayer').IntlayerConfig} */
1691
+ const config = {
1692
+ // ... Resto da sua configuração
1693
+ compiler: {
1694
+ /**
1695
+ * Indica se o compilador deve ser ativado.
1696
+ */
1697
+ enabled: true,
1698
+
1699
+ /**
1700
+ * Define o caminho dos arquivos de saída
1701
+ */
1702
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1703
+
1704
+ /**
1705
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
1706
+ */
1707
+ saveComponents: false,
1708
+
1709
+ /**
1710
+ * Prefixo da chave do dicionário
1711
+ */
1712
+ dictionaryKeyPrefix: "",
1713
+ },
1714
+ };
1715
+
1716
+ export default config;
1717
+ ```
1718
+
1719
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
1720
+ /** @type {import('intlayer').IntlayerConfig} */
1721
+ const config = {
1722
+ // ... Resto da sua configuração
1723
+ compiler: {
1724
+ /**
1725
+ * Indica se o compilador deve ser ativado.
1726
+ */
1727
+ enabled: true,
1728
+
1729
+ /**
1730
+ * Define o caminho dos arquivos de saída
1731
+ */
1732
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1733
+
1734
+ /**
1735
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
1736
+ */
1737
+ saveComponents: false,
1738
+
1739
+ /**
1740
+ * Prefixo da chave do dicionário
1741
+ */
1742
+ dictionaryKeyPrefix: "",
1743
+ },
1744
+ };
1745
+
1746
+ module.exports = config;
1747
+ ```
1748
+
1749
+ <Tabs>
1750
+ <Tab value='Comando de extração'>
1751
+
1752
+ Execute o extrator para transformar seus componentes e extrair o conteúdo
1753
+
1754
+ ```bash packageManager="npm"
1755
+ npx intlayer extract
1756
+ ```
1757
+
1758
+ ```bash packageManager="pnpm"
1759
+ pnpm intlayer extract
1760
+ ```
1761
+
1762
+ ```bash packageManager="yarn"
1763
+ yarn intlayer extract
1764
+ ```
1765
+
1766
+ ```bash packageManager="bun"
1767
+ bunx intlayer extract
1768
+ ```
1769
+
1770
+ </Tab>
1771
+ <Tab value='Compilador Babel'>
1772
+
1773
+ ```bash packageManager="npm"
1774
+ npm install @intlayer/babel --save-dev
1775
+ ```
1776
+
1777
+ ```bash packageManager="pnpm"
1778
+ pnpm add @intlayer/babel --save-dev
1779
+ ```
1780
+
1781
+ ```bash packageManager="yarn"
1782
+ yarn add @intlayer/babel --save-dev
1783
+ ```
1784
+
1785
+ ```bash packageManager="bun"
1786
+ bun add @intlayer/babel --dev
1787
+ ```
1788
+
1789
+ ```js fileName="babel.config.js"
1790
+ const {
1791
+ intlayerExtractBabelPlugin,
1792
+ getExtractPluginOptions,
1793
+ } = require("@intlayer/babel");
1794
+
1795
+ module.exports = {
1796
+ presets: ["next/babel"],
1797
+ plugins: [
1798
+ // Extrair conteúdo de componentes para dicionários
1799
+ [intlayerExtractBabelPlugin, getExtractPluginOptions()],
1800
+ ],
1801
+ };
1802
+ ```
1803
+
1804
+ ```bash packageManager="npm"
1805
+ npm run build # Ou npm run dev
1806
+ ```
1807
+
1808
+ ```bash packageManager="pnpm"
1809
+ pnpm run build # Or pnpm run dev
1810
+ ```
1811
+
1812
+ ```bash packageManager="yarn"
1813
+ yarn build # Or yarn dev
1814
+ ```
1815
+
1816
+ ```bash packageManager="bun"
1817
+ bun run build # Or bun run dev
1818
+ ```
1819
+
1820
+ </Tab>
1821
+ </Tabs>
1822
+
1650
1823
  ### Configurar TypeScript
1651
1824
 
1652
1825
  O Intlayer usa aumento de módulo para obter benefícios do TypeScript e tornar seu código mais robusto.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2026-01-10
3
- updatedAt: 2026-01-10
3
+ updatedAt: 2026-03-12
4
4
  title: Next.js i18n - Transforme uma aplicação Next.js existente numa aplicação multilíngue em 2026
5
5
  description: Descubra como tornar a sua aplicação Next.js existente multilíngue usando o Compilador Intlayer. Siga a documentação para internacionalizar (i18n) e traduzir o seu aplicativo com IA.
6
6
  keywords:
@@ -455,6 +455,179 @@ bun add @intlayer/swc --dev
455
455
 
456
456
  > Nota: Se definir a opção como `importMode: 'dynamic'` ou `importMode: 'fetch'` (na configuração `dictionary`), ele dependerá de Suspense, pelo que terá de envolver as suas chamadas `useIntlayer` numa boundary de `Suspense`. Isso significa que não poderá usar o `useIntlayer` diretamente no nível superior do seu componente Página / Layout.
457
457
 
458
+ ### (Opcional) Etapa 11 : Extrair o conteúdo dos seus componentes
459
+
460
+ Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
461
+
462
+ Para facilitar esse processo, o Intlayer propõe um [compilador](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/compiler.md) / [extrator](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/cli/extract.md) para transformar seus componentes e extrair o conteúdo.
463
+
464
+ Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
465
+
466
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
467
+ import { type IntlayerConfig } from "intlayer";
468
+
469
+ const config: IntlayerConfig = {
470
+ // ... Resto da sua configuração
471
+ compiler: {
472
+ /**
473
+ * Indica se o compilador deve ser ativado.
474
+ */
475
+ enabled: true,
476
+
477
+ /**
478
+ * Define o caminho dos arquivos de saída
479
+ */
480
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
481
+
482
+ /**
483
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
484
+ */
485
+ saveComponents: false,
486
+
487
+ /**
488
+ * Prefixo da chave do dicionário
489
+ */
490
+ dictionaryKeyPrefix: "",
491
+ },
492
+ };
493
+
494
+ export default config;
495
+ ```
496
+
497
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
498
+ /** @type {import('intlayer').IntlayerConfig} */
499
+ const config = {
500
+ // ... Resto da sua configuração
501
+ compiler: {
502
+ /**
503
+ * Indica se o compilador deve ser ativado.
504
+ */
505
+ enabled: true,
506
+
507
+ /**
508
+ * Define o caminho dos arquivos de saída
509
+ */
510
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
511
+
512
+ /**
513
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
514
+ */
515
+ saveComponents: false,
516
+
517
+ /**
518
+ * Prefixo da chave do dicionário
519
+ */
520
+ dictionaryKeyPrefix: "",
521
+ },
522
+ };
523
+
524
+ export default config;
525
+ ```
526
+
527
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
528
+ /** @type {import('intlayer').IntlayerConfig} */
529
+ const config = {
530
+ // ... Resto da sua configuração
531
+ compiler: {
532
+ /**
533
+ * Indica se o compilador deve ser ativado.
534
+ */
535
+ enabled: true,
536
+
537
+ /**
538
+ * Define o caminho dos arquivos de saída
539
+ */
540
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
541
+
542
+ /**
543
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
544
+ */
545
+ saveComponents: false,
546
+
547
+ /**
548
+ * Prefixo da chave do dicionário
549
+ */
550
+ dictionaryKeyPrefix: "",
551
+ },
552
+ };
553
+
554
+ module.exports = config;
555
+ ```
556
+
557
+ <Tabs>
558
+ <Tab value='Comando de extração'>
559
+
560
+ Execute o extrator para transformar seus componentes e extrair o conteúdo
561
+
562
+ ```bash packageManager="npm"
563
+ npx intlayer extract
564
+ ```
565
+
566
+ ```bash packageManager="pnpm"
567
+ pnpm intlayer extract
568
+ ```
569
+
570
+ ```bash packageManager="yarn"
571
+ yarn intlayer extract
572
+ ```
573
+
574
+ ```bash packageManager="bun"
575
+ bunx intlayer extract
576
+ ```
577
+
578
+ </Tab>
579
+ <Tab value='Compilador Babel'>
580
+
581
+ ```bash packageManager="npm"
582
+ npm install @intlayer/babel --save-dev
583
+ ```
584
+
585
+ ```bash packageManager="pnpm"
586
+ pnpm add @intlayer/babel --save-dev
587
+ ```
588
+
589
+ ```bash packageManager="yarn"
590
+ yarn add @intlayer/babel --save-dev
591
+ ```
592
+
593
+ ```bash packageManager="bun"
594
+ bun add @intlayer/babel --dev
595
+ ```
596
+
597
+ ```js fileName="babel.config.js"
598
+ const {
599
+ intlayerExtractBabelPlugin,
600
+ getExtractPluginOptions,
601
+ } = require("@intlayer/babel");
602
+
603
+ module.exports = {
604
+ presets: ["next/babel"],
605
+ plugins: [
606
+ // Extrair conteúdo de componentes para dicionários
607
+ [intlayerExtractBabelPlugin, getExtractPluginOptions()],
608
+ ],
609
+ };
610
+ ```
611
+
612
+ ```bash packageManager="npm"
613
+ npm run build # Ou npm run dev
614
+ ```
615
+
616
+ ```bash packageManager="pnpm"
617
+ pnpm run build # Or pnpm run dev
618
+ ```
619
+
620
+ ```bash packageManager="yarn"
621
+ yarn build # Or yarn dev
622
+ ```
623
+
624
+ ```bash packageManager="bun"
625
+ bun run build # Or bun run dev
626
+ ```
627
+
628
+ </Tab>
629
+ </Tabs>
630
+
458
631
  ### Configurar TypeScript
459
632
 
460
633
  O Intlayer usa module augmentation para obter os benefícios do TypeScript e tornar a sua base de código mais robusta.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-09-04
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: React Router v7 i18n - Como traduzir uma aplicação React Router v7 em 2026
5
5
  description: Aprenda como adicionar internacionalização (i18n) à sua aplicação React Router v7 usando Intlayer. Siga este guia completo para tornar seu app multilíngue com roteamento sensível à localidade.
6
6
  keywords:
@@ -528,6 +528,229 @@ Certifique-se de que sua configuração do TypeScript inclua os tipos gerados au
528
528
  }
529
529
  ```
530
530
 
531
+ ### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
532
+
533
+ Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
534
+
535
+ Para facilitar esse processo, o Intlayer propõe um [compilador](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/compiler.md) / [extrator](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/cli/extract.md) para transformar seus componentes e extrair o conteúdo.
536
+
537
+ Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
538
+
539
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
540
+ import { type IntlayerConfig } from "intlayer";
541
+
542
+ const config: IntlayerConfig = {
543
+ // ... Resto da sua configuração
544
+ compiler: {
545
+ /**
546
+ * Indica se o compilador deve ser ativado.
547
+ */
548
+ enabled: true,
549
+
550
+ /**
551
+ * Define o caminho dos arquivos de saída
552
+ */
553
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
554
+
555
+ /**
556
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
557
+ */
558
+ saveComponents: false,
559
+
560
+ /**
561
+ * Prefixo da chave do dicionário
562
+ */
563
+ dictionaryKeyPrefix: "",
564
+ },
565
+ };
566
+
567
+ export default config;
568
+ ```
569
+
570
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
571
+ /** @type {import('intlayer').IntlayerConfig} */
572
+ const config = {
573
+ // ... Resto da sua configuração
574
+ compiler: {
575
+ /**
576
+ * Indica se o compilador deve ser ativado.
577
+ */
578
+ enabled: true,
579
+
580
+ /**
581
+ * Define o caminho dos arquivos de saída
582
+ */
583
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
584
+
585
+ /**
586
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
587
+ */
588
+ saveComponents: false,
589
+
590
+ /**
591
+ * Prefixo da chave do dicionário
592
+ */
593
+ dictionaryKeyPrefix: "",
594
+ },
595
+ };
596
+
597
+ export default config;
598
+ ```
599
+
600
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
601
+ /** @type {import('intlayer').IntlayerConfig} */
602
+ const config = {
603
+ // ... Resto da sua configuração
604
+ compiler: {
605
+ /**
606
+ * Indica se o compilador deve ser ativado.
607
+ */
608
+ enabled: true,
609
+
610
+ /**
611
+ * Define o caminho dos arquivos de saída
612
+ */
613
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
614
+
615
+ /**
616
+ * Indica se os componentes devem ser salvos após serem transformados. Dessa forma, o compilador pode ser executado apenas uma vez para transformar o aplicativo e depois removido.
617
+ */
618
+ saveComponents: false,
619
+
620
+ /**
621
+ * Prefixo da chave do dicionário
622
+ */
623
+ dictionaryKeyPrefix: "",
624
+ },
625
+ };
626
+
627
+ module.exports = config;
628
+ ```
629
+
630
+ <Tabs>
631
+ <Tab value='Comando de extração'>
632
+
633
+ Execute o extrator para transformar seus componentes e extrair o conteúdo
634
+
635
+ ```bash packageManager="npm"
636
+ npx intlayer extract
637
+ ```
638
+
639
+ ```bash packageManager="pnpm"
640
+ pnpm intlayer extract
641
+ ```
642
+
643
+ ```bash packageManager="yarn"
644
+ yarn intlayer extract
645
+ ```
646
+
647
+ ```bash packageManager="bun"
648
+ bunx intlayer extract
649
+ ```
650
+
651
+ </Tab>
652
+ <Tab value='Compilador Babel'>
653
+
654
+ Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
655
+
656
+ ```ts fileName="vite.config.ts"
657
+ import { defineConfig } from "vite";
658
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
659
+
660
+ export default defineConfig({
661
+ plugins: [
662
+ intlayer(),
663
+ intlayerCompiler(), // Adiciona o plugin do compilador
664
+ ],
665
+ });
666
+ ```
667
+
668
+ ```bash packageManager="npm"
669
+ npm run build # Ou npm run dev
670
+ ```
671
+
672
+ ```bash packageManager="pnpm"
673
+ pnpm run build # Or pnpm run dev
674
+ ```
675
+
676
+ ```bash packageManager="yarn"
677
+ yarn build # Or yarn dev
678
+ ```
679
+
680
+ ```bash packageManager="bun"
681
+ bun run build # Or bun run dev
682
+ ```
683
+
684
+ </Tab>
685
+ </Tabs>
686
+
687
+ ---
688
+
689
+ ## Configure TypeScript
690
+
691
+ Intlayer uses module augmentation to get benefits of TypeScript and make your codebase stronger.
692
+
693
+ Ensure your TypeScript configuration includes the autogenerated types:
694
+
695
+ ```json5 fileName="tsconfig.json"
696
+ {
697
+ // ... your existing configurations
698
+ include: [
699
+ // ... your existing includes
700
+ ".intlayer/**/*.ts", // Include the auto-generated types
701
+ ],
702
+ }
703
+ ```
704
+
705
+ ---
706
+
707
+ ## Git Configuration
708
+
709
+ It is recommended to ignore the files generated by Intlayer. This allows you to avoid committing them to your Git repository.
710
+
711
+ To do this, you can add the following instructions to your `.gitignore` file:
712
+
713
+ ```plaintext fileName=".gitignore"
714
+ # Ignore the files generated by Intlayer
715
+ .intlayer
716
+ ```
717
+
718
+ ---
719
+
720
+ ## VS Code Extension
721
+
722
+ To improve your development experience with Intlayer, you can install the official **Intlayer VS Code Extension**.
723
+
724
+ [Install from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
725
+
726
+ This extension provides:
727
+
728
+ - **Autocompletion** for translation keys.
729
+ - **Real-time error detection** for missing translations.
730
+ - **Inline previews** of translated content.
731
+ - **Quick actions** to easily create and update translations.
732
+
733
+ For more details on how to use the extension, refer to the [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
734
+
735
+ ---
736
+
737
+ ## Go Further
738
+
739
+ To go further, you can implement the [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) or externalize your content using the [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md).
740
+
741
+ ---
742
+
743
+ ## Documentation References
744
+
745
+ - [Intlayer Documentation](https://intlayer.org)
746
+ - [React Router v7 Documentation](https://reactrouter.com/)
747
+ - [useIntlayer hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useIntlayer.md)
748
+ - [useLocale hook](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/packages/react-intlayer/useLocale.md)
749
+ - [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md)
750
+ - [Configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md)
751
+
752
+ This comprehensive guide provides everything you need to integrate Intlayer with React Router v7 for a fully internationalized application with locale-aware routing and TypeScript support.
753
+
531
754
  ### Configuração do Git
532
755
 
533
756
  É recomendado ignorar os arquivos gerados pelo Intlayer. Isso permite evitar que eles sejam commitados no seu repositório Git.