@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: 2025-04-18
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: Vite + Preact i18n - Como traduzir uma aplicação Preact em 2026
5
5
  description: Descubra como tornar seu site Vite e Preact multilíngue. Siga a documentação para internacionalizar (i18n) e traduzir.
6
6
  keywords:
@@ -1303,6 +1303,162 @@ return (
1303
1303
  );
1304
1304
  ```
1305
1305
 
1306
+ ### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
1307
+
1308
+ Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
1309
+
1310
+ 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.
1311
+
1312
+ Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
1313
+
1314
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
1315
+ import { type IntlayerConfig } from "intlayer";
1316
+
1317
+ const config: IntlayerConfig = {
1318
+ // ... Resto da sua configuração
1319
+ compiler: {
1320
+ /**
1321
+ * Indica se o compilador deve ser ativado.
1322
+ */
1323
+ enabled: true,
1324
+
1325
+ /**
1326
+ * Define o caminho dos arquivos de saída
1327
+ */
1328
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1329
+
1330
+ /**
1331
+ * 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.
1332
+ */
1333
+ saveComponents: false,
1334
+
1335
+ /**
1336
+ * Prefixo da chave do dicionário
1337
+ */
1338
+ dictionaryKeyPrefix: "",
1339
+ },
1340
+ };
1341
+
1342
+ export default config;
1343
+ ```
1344
+
1345
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
1346
+ /** @type {import('intlayer').IntlayerConfig} */
1347
+ const config = {
1348
+ // ... Resto da sua configuração
1349
+ compiler: {
1350
+ /**
1351
+ * Indica se o compilador deve ser ativado.
1352
+ */
1353
+ enabled: true,
1354
+
1355
+ /**
1356
+ * Define o caminho dos arquivos de saída
1357
+ */
1358
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1359
+
1360
+ /**
1361
+ * 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.
1362
+ */
1363
+ saveComponents: false,
1364
+
1365
+ /**
1366
+ * Prefixo da chave do dicionário
1367
+ */
1368
+ dictionaryKeyPrefix: "",
1369
+ },
1370
+ };
1371
+
1372
+ export default config;
1373
+ ```
1374
+
1375
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
1376
+ /** @type {import('intlayer').IntlayerConfig} */
1377
+ const config = {
1378
+ // ... Resto da sua configuração
1379
+ compiler: {
1380
+ /**
1381
+ * Indica se o compilador deve ser ativado.
1382
+ */
1383
+ enabled: true,
1384
+
1385
+ /**
1386
+ * Define o caminho dos arquivos de saída
1387
+ */
1388
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1389
+
1390
+ /**
1391
+ * 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.
1392
+ */
1393
+ saveComponents: false,
1394
+
1395
+ /**
1396
+ * Prefixo da chave do dicionário
1397
+ */
1398
+ dictionaryKeyPrefix: "",
1399
+ },
1400
+ };
1401
+
1402
+ module.exports = config;
1403
+ ```
1404
+
1405
+ <Tabs>
1406
+ <Tab value='Comando de extração'>
1407
+
1408
+ Execute o extrator para transformar seus componentes e extrair o conteúdo
1409
+
1410
+ ```bash packageManager="npm"
1411
+ npx intlayer extract
1412
+ ```
1413
+
1414
+ ```bash packageManager="pnpm"
1415
+ pnpm intlayer extract
1416
+ ```
1417
+
1418
+ ```bash packageManager="yarn"
1419
+ yarn intlayer extract
1420
+ ```
1421
+
1422
+ ```bash packageManager="bun"
1423
+ bunx intlayer extract
1424
+ ```
1425
+
1426
+ </Tab>
1427
+ <Tab value='Compilador Babel'>
1428
+
1429
+ Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
1430
+
1431
+ ```ts fileName="vite.config.ts"
1432
+ import { defineConfig } from "vite";
1433
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
1434
+
1435
+ export default defineConfig({
1436
+ plugins: [
1437
+ intlayer(),
1438
+ intlayerCompiler(), // Adiciona o plugin do compilador
1439
+ ],
1440
+ });
1441
+ ```
1442
+
1443
+ ```bash packageManager="npm"
1444
+ npm run build # Ou npm run dev
1445
+ ```
1446
+
1447
+ ```bash packageManager="pnpm"
1448
+ pnpm run build # Or pnpm run dev
1449
+ ```
1450
+
1451
+ ```bash packageManager="yarn"
1452
+ yarn build # Or yarn dev
1453
+ ```
1454
+
1455
+ ```bash packageManager="bun"
1456
+ bun run build # Or bun run dev
1457
+ ```
1458
+
1459
+ </Tab>
1460
+ </Tabs>
1461
+
1306
1462
  ### Configurar TypeScript
1307
1463
 
1308
1464
  O Intlayer usa aumento de módulo para obter benefícios do TypeScript e tornar sua base de código mais forte.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-03-07
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: Vite + React i18n - Como traduzir uma aplicação React em 2026
5
5
  description: Aprenda como adicionar internacionalização (i18n) à sua aplicação Vite e React usando Intlayer. Siga este guia para tornar seu app multilíngue.
6
6
  keywords:
@@ -1372,6 +1372,162 @@ Link.displayName = "Link";
1372
1372
 
1373
1373
  Ao integrar este componente `Link` em toda a sua aplicação, você mantém uma experiência de usuário coerente e consciente do idioma, além de beneficiar-se de uma melhor SEO e usabilidade.
1374
1374
 
1375
+ ### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
1376
+
1377
+ Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
1378
+
1379
+ 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.
1380
+
1381
+ Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
1382
+
1383
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
1384
+ import { type IntlayerConfig } from "intlayer";
1385
+
1386
+ const config: IntlayerConfig = {
1387
+ // ... Resto da sua configuração
1388
+ compiler: {
1389
+ /**
1390
+ * Indica se o compilador deve ser ativado.
1391
+ */
1392
+ enabled: true,
1393
+
1394
+ /**
1395
+ * Define o caminho dos arquivos de saída
1396
+ */
1397
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1398
+
1399
+ /**
1400
+ * 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.
1401
+ */
1402
+ saveComponents: false,
1403
+
1404
+ /**
1405
+ * Prefixo da chave do dicionário
1406
+ */
1407
+ dictionaryKeyPrefix: "",
1408
+ },
1409
+ };
1410
+
1411
+ export default config;
1412
+ ```
1413
+
1414
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
1415
+ /** @type {import('intlayer').IntlayerConfig} */
1416
+ const config = {
1417
+ // ... Resto da sua configuração
1418
+ compiler: {
1419
+ /**
1420
+ * Indica se o compilador deve ser ativado.
1421
+ */
1422
+ enabled: true,
1423
+
1424
+ /**
1425
+ * Define o caminho dos arquivos de saída
1426
+ */
1427
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1428
+
1429
+ /**
1430
+ * 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.
1431
+ */
1432
+ saveComponents: false,
1433
+
1434
+ /**
1435
+ * Prefixo da chave do dicionário
1436
+ */
1437
+ dictionaryKeyPrefix: "",
1438
+ },
1439
+ };
1440
+
1441
+ export default config;
1442
+ ```
1443
+
1444
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
1445
+ /** @type {import('intlayer').IntlayerConfig} */
1446
+ const config = {
1447
+ // ... Resto da sua configuração
1448
+ compiler: {
1449
+ /**
1450
+ * Indica se o compilador deve ser ativado.
1451
+ */
1452
+ enabled: true,
1453
+
1454
+ /**
1455
+ * Define o caminho dos arquivos de saída
1456
+ */
1457
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
1458
+
1459
+ /**
1460
+ * 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.
1461
+ */
1462
+ saveComponents: false,
1463
+
1464
+ /**
1465
+ * Prefixo da chave do dicionário
1466
+ */
1467
+ dictionaryKeyPrefix: "",
1468
+ },
1469
+ };
1470
+
1471
+ module.exports = config;
1472
+ ```
1473
+
1474
+ <Tabs>
1475
+ <Tab value='Comando de extração'>
1476
+
1477
+ Execute o extrator para transformar seus componentes e extrair o conteúdo
1478
+
1479
+ ```bash packageManager="npm"
1480
+ npx intlayer extract
1481
+ ```
1482
+
1483
+ ```bash packageManager="pnpm"
1484
+ pnpm intlayer extract
1485
+ ```
1486
+
1487
+ ```bash packageManager="yarn"
1488
+ yarn intlayer extract
1489
+ ```
1490
+
1491
+ ```bash packageManager="bun"
1492
+ bunx intlayer extract
1493
+ ```
1494
+
1495
+ </Tab>
1496
+ <Tab value='Compilador Babel'>
1497
+
1498
+ Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
1499
+
1500
+ ```ts fileName="vite.config.ts"
1501
+ import { defineConfig } from "vite";
1502
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
1503
+
1504
+ export default defineConfig({
1505
+ plugins: [
1506
+ intlayer(),
1507
+ intlayerCompiler(), // Adiciona o plugin do compilador
1508
+ ],
1509
+ });
1510
+ ```
1511
+
1512
+ ```bash packageManager="npm"
1513
+ npm run build # Ou npm run dev
1514
+ ```
1515
+
1516
+ ```bash packageManager="pnpm"
1517
+ pnpm run build # Or pnpm run dev
1518
+ ```
1519
+
1520
+ ```bash packageManager="yarn"
1521
+ yarn build # Or yarn dev
1522
+ ```
1523
+
1524
+ ```bash packageManager="bun"
1525
+ bun run build # Or bun run dev
1526
+ ```
1527
+
1528
+ </Tab>
1529
+ </Tabs>
1530
+
1375
1531
  ### Configurar TypeScript
1376
1532
 
1377
1533
  O Intlayer utiliza a ampliação de módulos para aproveitar os benefícios do TypeScript e tornar sua base de código mais robusta.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-04-18
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: Vite + Solid i18n - Como traduzir uma aplicação Solid em 2026
5
5
  description: Descubra como tornar seu site Vite e Solid multilíngue. Siga a documentação para internacionalizar (i18n) e traduzir.
6
6
  keywords:
@@ -534,6 +534,162 @@ const MyComponent = () => {
534
534
  };
535
535
  ```
536
536
 
537
+ ### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
538
+
539
+ Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
540
+
541
+ 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.
542
+
543
+ Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
544
+
545
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
546
+ import { type IntlayerConfig } from "intlayer";
547
+
548
+ const config: IntlayerConfig = {
549
+ // ... Resto da sua configuração
550
+ compiler: {
551
+ /**
552
+ * Indica se o compilador deve ser ativado.
553
+ */
554
+ enabled: true,
555
+
556
+ /**
557
+ * Define o caminho dos arquivos de saída
558
+ */
559
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
560
+
561
+ /**
562
+ * 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.
563
+ */
564
+ saveComponents: false,
565
+
566
+ /**
567
+ * Prefixo da chave do dicionário
568
+ */
569
+ dictionaryKeyPrefix: "",
570
+ },
571
+ };
572
+
573
+ export default config;
574
+ ```
575
+
576
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
577
+ /** @type {import('intlayer').IntlayerConfig} */
578
+ const config = {
579
+ // ... Resto da sua configuração
580
+ compiler: {
581
+ /**
582
+ * Indica se o compilador deve ser ativado.
583
+ */
584
+ enabled: true,
585
+
586
+ /**
587
+ * Define o caminho dos arquivos de saída
588
+ */
589
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
590
+
591
+ /**
592
+ * 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.
593
+ */
594
+ saveComponents: false,
595
+
596
+ /**
597
+ * Prefixo da chave do dicionário
598
+ */
599
+ dictionaryKeyPrefix: "",
600
+ },
601
+ };
602
+
603
+ export default config;
604
+ ```
605
+
606
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
607
+ /** @type {import('intlayer').IntlayerConfig} */
608
+ const config = {
609
+ // ... Resto da sua configuração
610
+ compiler: {
611
+ /**
612
+ * Indica se o compilador deve ser ativado.
613
+ */
614
+ enabled: true,
615
+
616
+ /**
617
+ * Define o caminho dos arquivos de saída
618
+ */
619
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
620
+
621
+ /**
622
+ * 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.
623
+ */
624
+ saveComponents: false,
625
+
626
+ /**
627
+ * Prefixo da chave do dicionário
628
+ */
629
+ dictionaryKeyPrefix: "",
630
+ },
631
+ };
632
+
633
+ module.exports = config;
634
+ ```
635
+
636
+ <Tabs>
637
+ <Tab value='Comando de extração'>
638
+
639
+ Execute o extrator para transformar seus componentes e extrair o conteúdo
640
+
641
+ ```bash packageManager="npm"
642
+ npx intlayer extract
643
+ ```
644
+
645
+ ```bash packageManager="pnpm"
646
+ pnpm intlayer extract
647
+ ```
648
+
649
+ ```bash packageManager="yarn"
650
+ yarn intlayer extract
651
+ ```
652
+
653
+ ```bash packageManager="bun"
654
+ bunx intlayer extract
655
+ ```
656
+
657
+ </Tab>
658
+ <Tab value='Compilador Babel'>
659
+
660
+ Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
661
+
662
+ ```ts fileName="vite.config.ts"
663
+ import { defineConfig } from "vite";
664
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
665
+
666
+ export default defineConfig({
667
+ plugins: [
668
+ intlayer(),
669
+ intlayerCompiler(), // Adiciona o plugin do compilador
670
+ ],
671
+ });
672
+ ```
673
+
674
+ ```bash packageManager="npm"
675
+ npm run build # Ou npm run dev
676
+ ```
677
+
678
+ ```bash packageManager="pnpm"
679
+ pnpm run build # Or pnpm run dev
680
+ ```
681
+
682
+ ```bash packageManager="yarn"
683
+ yarn build # Or yarn dev
684
+ ```
685
+
686
+ ```bash packageManager="bun"
687
+ bun run build # Or bun run dev
688
+ ```
689
+
690
+ </Tab>
691
+ </Tabs>
692
+
537
693
  ### Configurar TypeScript
538
694
 
539
695
  Certifique-se de que a sua configuração TypeScript inclui os tipos autogerados.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-04-18
3
- updatedAt: 2025-12-30
3
+ updatedAt: 2026-03-12
4
4
  title: Vite + Svelte i18n - Como traduzir uma aplicação Svelte em 2026
5
5
  description: Descubra como tornar seu site Vite e Svelte multilíngue. Siga a documentação para internacionalizar (i18n) e traduzir.
6
6
  keywords:
@@ -513,6 +513,162 @@ Para mais detalhes sobre como usar a extensão, consulte a [documentação da In
513
513
 
514
514
  ---
515
515
 
516
+ ### (Opcional) Etapa 1 : Extrair o conteúdo dos seus componentes
517
+
518
+ Se você tiver uma base de código existente, transformar milhares de arquivos pode ser demorado.
519
+
520
+ 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.
521
+
522
+ Para configurá-lo, você pode adicionar uma seção `compiler` no seu arquivo `intlayer.config.ts`:
523
+
524
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
525
+ import { type IntlayerConfig } from "intlayer";
526
+
527
+ const config: IntlayerConfig = {
528
+ // ... Resto da sua configuração
529
+ compiler: {
530
+ /**
531
+ * Indica se o compilador deve ser ativado.
532
+ */
533
+ enabled: true,
534
+
535
+ /**
536
+ * Define o caminho dos arquivos de saída
537
+ */
538
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
539
+
540
+ /**
541
+ * 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.
542
+ */
543
+ saveComponents: false,
544
+
545
+ /**
546
+ * Prefixo da chave do dicionário
547
+ */
548
+ dictionaryKeyPrefix: "",
549
+ },
550
+ };
551
+
552
+ export default config;
553
+ ```
554
+
555
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
556
+ /** @type {import('intlayer').IntlayerConfig} */
557
+ const config = {
558
+ // ... Resto da sua configuração
559
+ compiler: {
560
+ /**
561
+ * Indica se o compilador deve ser ativado.
562
+ */
563
+ enabled: true,
564
+
565
+ /**
566
+ * Define o caminho dos arquivos de saída
567
+ */
568
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
569
+
570
+ /**
571
+ * 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.
572
+ */
573
+ saveComponents: false,
574
+
575
+ /**
576
+ * Prefixo da chave do dicionário
577
+ */
578
+ dictionaryKeyPrefix: "",
579
+ },
580
+ };
581
+
582
+ export default config;
583
+ ```
584
+
585
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
586
+ /** @type {import('intlayer').IntlayerConfig} */
587
+ const config = {
588
+ // ... Resto da sua configuração
589
+ compiler: {
590
+ /**
591
+ * Indica se o compilador deve ser ativado.
592
+ */
593
+ enabled: true,
594
+
595
+ /**
596
+ * Define o caminho dos arquivos de saída
597
+ */
598
+ output: ({ fileName, extension }) => `./${fileName}${extension}`,
599
+
600
+ /**
601
+ * 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.
602
+ */
603
+ saveComponents: false,
604
+
605
+ /**
606
+ * Prefixo da chave do dicionário
607
+ */
608
+ dictionaryKeyPrefix: "",
609
+ },
610
+ };
611
+
612
+ module.exports = config;
613
+ ```
614
+
615
+ <Tabs>
616
+ <Tab value='Comando de extração'>
617
+
618
+ Execute o extrator para transformar seus componentes e extrair o conteúdo
619
+
620
+ ```bash packageManager="npm"
621
+ npx intlayer extract
622
+ ```
623
+
624
+ ```bash packageManager="pnpm"
625
+ pnpm intlayer extract
626
+ ```
627
+
628
+ ```bash packageManager="yarn"
629
+ yarn intlayer extract
630
+ ```
631
+
632
+ ```bash packageManager="bun"
633
+ bunx intlayer extract
634
+ ```
635
+
636
+ </Tab>
637
+ <Tab value='Compilador Babel'>
638
+
639
+ Atualize seu `vite.config.ts` para incluir o plugin `intlayerCompiler`:
640
+
641
+ ```ts fileName="vite.config.ts"
642
+ import { defineConfig } from "vite";
643
+ import { intlayer, intlayerCompiler } from "vite-intlayer";
644
+
645
+ export default defineConfig({
646
+ plugins: [
647
+ intlayer(),
648
+ intlayerCompiler(), // Adiciona o plugin do compilador
649
+ ],
650
+ });
651
+ ```
652
+
653
+ ```bash packageManager="npm"
654
+ npm run build # Ou npm run dev
655
+ ```
656
+
657
+ ```bash packageManager="pnpm"
658
+ pnpm run build # Or pnpm run dev
659
+ ```
660
+
661
+ ```bash packageManager="yarn"
662
+ yarn build # Or yarn dev
663
+ ```
664
+
665
+ ```bash packageManager="bun"
666
+ bun run build # Or bun run dev
667
+ ```
668
+
669
+ </Tab>
670
+ </Tabs>
671
+
516
672
  ### Ir Além
517
673
 
518
674
  Para ir mais longe, você pode implementar o [editor visual](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/intlayer_visual_editor.md) ou externalizar seu conteúdo usando o [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/pt/intlayer_CMS.md).