@intlayer/docs 6.0.0 → 6.0.2-canary.0

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 (104) hide show
  1. package/dist/cjs/blog.cjs.map +1 -1
  2. package/dist/cjs/common.cjs +6 -5
  3. package/dist/cjs/common.cjs.map +1 -1
  4. package/dist/cjs/generated/blog.entry.cjs +318 -1863
  5. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  6. package/dist/cjs/generated/docs.entry.cjs +1317 -6282
  7. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  8. package/dist/cjs/generated/frequentQuestions.entry.cjs +197 -1182
  9. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  10. package/dist/cjs/generated/legal.entry.cjs +43 -84
  11. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  12. package/dist/esm/blog.mjs.map +1 -1
  13. package/dist/esm/common.mjs +2 -5
  14. package/dist/esm/common.mjs.map +1 -1
  15. package/dist/esm/generated/blog.entry.mjs +318 -1863
  16. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  17. package/dist/esm/generated/docs.entry.mjs +1317 -6282
  18. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  19. package/dist/esm/generated/frequentQuestions.entry.mjs +197 -1182
  20. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  21. package/dist/esm/generated/legal.entry.mjs +43 -84
  22. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  23. package/dist/types/blog.d.ts +1 -1
  24. package/dist/types/blog.d.ts.map +1 -1
  25. package/dist/types/common.d.ts +1 -1
  26. package/dist/types/common.d.ts.map +1 -1
  27. package/dist/types/generated/blog.entry.d.ts +1 -1
  28. package/dist/types/generated/blog.entry.d.ts.map +1 -1
  29. package/dist/types/generated/docs.entry.d.ts +2 -1
  30. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  31. package/dist/types/generated/frequentQuestions.entry.d.ts +1 -1
  32. package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
  33. package/dist/types/generated/legal.entry.d.ts +1 -1
  34. package/dist/types/generated/legal.entry.d.ts.map +1 -1
  35. package/docs/ar/intlayer_CMS.md +261 -85
  36. package/docs/ar/releases/v6.md +273 -0
  37. package/docs/ar/roadmap.md +1 -3
  38. package/docs/ar/vs_code_extension.md +94 -63
  39. package/docs/de/intlayer_CMS.md +247 -65
  40. package/docs/de/releases/v6.md +298 -0
  41. package/docs/de/roadmap.md +1 -3
  42. package/docs/de/vs_code_extension.md +89 -58
  43. package/docs/en/configuration.md +9 -2
  44. package/docs/en/intlayer_CMS.md +205 -23
  45. package/docs/en/intlayer_cli.md +4 -4
  46. package/docs/en/intlayer_visual_editor.md +7 -6
  47. package/docs/en/intlayer_with_nextjs_14.md +17 -1
  48. package/docs/en/intlayer_with_nextjs_15.md +17 -1
  49. package/docs/en/releases/v6.md +268 -0
  50. package/docs/en/roadmap.md +1 -3
  51. package/docs/en/vs_code_extension.md +79 -49
  52. package/docs/en-GB/intlayer_CMS.md +216 -52
  53. package/docs/en-GB/releases/v6.md +297 -0
  54. package/docs/en-GB/roadmap.md +1 -3
  55. package/docs/en-GB/vs_code_extension.md +79 -48
  56. package/docs/es/intlayer_CMS.md +257 -84
  57. package/docs/es/releases/v6.md +274 -0
  58. package/docs/es/roadmap.md +1 -3
  59. package/docs/es/vs_code_extension.md +90 -60
  60. package/docs/fr/intlayer_CMS.md +250 -68
  61. package/docs/fr/releases/v6.md +274 -0
  62. package/docs/fr/roadmap.md +1 -3
  63. package/docs/fr/vs_code_extension.md +94 -63
  64. package/docs/hi/intlayer_CMS.md +253 -77
  65. package/docs/hi/releases/v6.md +273 -0
  66. package/docs/hi/roadmap.md +1 -3
  67. package/docs/hi/vs_code_extension.md +92 -61
  68. package/docs/it/intlayer_CMS.md +251 -73
  69. package/docs/it/releases/v6.md +273 -0
  70. package/docs/it/roadmap.md +1 -3
  71. package/docs/it/vs_code_extension.md +94 -63
  72. package/docs/ja/intlayer_CMS.md +282 -97
  73. package/docs/ja/releases/v6.md +273 -0
  74. package/docs/ja/roadmap.md +1 -3
  75. package/docs/ja/vs_code_extension.md +99 -68
  76. package/docs/ko/intlayer_CMS.md +267 -93
  77. package/docs/ko/releases/v6.md +273 -0
  78. package/docs/ko/roadmap.md +1 -3
  79. package/docs/ko/vs_code_extension.md +88 -57
  80. package/docs/pt/intlayer_CMS.md +261 -83
  81. package/docs/pt/releases/v6.md +273 -0
  82. package/docs/pt/roadmap.md +1 -3
  83. package/docs/pt/vs_code_extension.md +89 -58
  84. package/docs/ru/intlayer_CMS.md +240 -65
  85. package/docs/ru/releases/v6.md +274 -0
  86. package/docs/ru/roadmap.md +1 -1
  87. package/docs/ru/vs_code_extension.md +83 -52
  88. package/docs/tr/intlayer_CMS.md +278 -96
  89. package/docs/tr/intlayer_with_nextjs_page_router.md +1 -1
  90. package/docs/tr/intlayer_with_tanstack.md +3 -0
  91. package/docs/tr/releases/v6.md +273 -0
  92. package/docs/tr/roadmap.md +1 -1
  93. package/docs/tr/vs_code_extension.md +100 -71
  94. package/docs/zh/intlayer_CMS.md +257 -76
  95. package/docs/zh/releases/v6.md +273 -0
  96. package/docs/zh/roadmap.md +1 -3
  97. package/docs/zh/vs_code_extension.md +99 -68
  98. package/package.json +9 -8
  99. package/src/blog.ts +1 -1
  100. package/src/common.ts +2 -6
  101. package/src/generated/blog.entry.ts +323 -1864
  102. package/src/generated/docs.entry.ts +1317 -6278
  103. package/src/generated/frequentQuestions.entry.ts +202 -1183
  104. package/src/generated/legal.entry.ts +48 -85
@@ -256,13 +256,13 @@ This command uploads your initial content dictionaries, making them available fo
256
256
 
257
257
  Then you will be able to see and manage your dictionary in the [Intlayer CMS](https://intlayer.org/dashboard/content).
258
258
 
259
- ## Hot reloading
259
+ ## Live sync
260
260
 
261
- The Intlayer CMS is able to hot reload the dictionaries when a change is detected.
261
+ Live Sync lets your app reflect CMS content changes at runtime. No rebuild or redeploy required. When enabled, updates are streamed to a Live Sync server that refreshes the dictionaries your application reads.
262
262
 
263
- Without the hot reloading, a new build of the application will be needed to display the new content.
263
+ > Live Sync requires a continuous server connection and is available on the enterprise plan.
264
264
 
265
- By activating the [`liveSync`](https://intlayer.org/doc/concept/configuration#editor-configuration) configuration, the application will automatically replace the updated content when it is detected.
265
+ Enable Live Sync by updating your Intlayer configuration:
266
266
 
267
267
  ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
268
268
  import type { IntlayerConfig } from "intlayer";
@@ -270,18 +270,32 @@ import type { IntlayerConfig } from "intlayer";
270
270
  const config: IntlayerConfig = {
271
271
  // ... other configuration settings
272
272
  editor: {
273
- // ... other configuration settings
274
-
275
273
  /**
276
- * Indicates if the application should hot reload the locale configurations when a change is detected.
277
- * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.
274
+ * Enables hot reloading of locale configurations when changes are detected.
275
+ * For example, when a dictionary is added or updated, the application updates
276
+ * the content displayed on the page.
278
277
  *
279
- * Because the hot reloading needs an continuous connection to the server, it is only available for clients of the `enterprise` plan
278
+ * Because hot reloading requires a continuous connection to the server, it is
279
+ * only available for clients of the `enterprise` plan.
280
280
  *
281
281
  * Default: false
282
282
  */
283
283
  liveSync: true,
284
284
  },
285
+ build: {
286
+ /**
287
+ * Controls how dictionaries are imported:
288
+ *
289
+ * - "live": Dictionaries are fetched dynamically using the Live Sync API.
290
+ * Replaces useIntlayer with useDictionaryDynamic.
291
+ *
292
+ * Note: Live mode uses the Live Sync API to fetch dictionaries. If the API call
293
+ * fails, dictionaries are imported dynamically.
294
+ * Note: Only dictionaries with remote content and "live" flags use live mode.
295
+ * Others use dynamic mode for performance.
296
+ */
297
+ importMode: "live",
298
+ },
285
299
  };
286
300
 
287
301
  export default config;
@@ -292,18 +306,32 @@ export default config;
292
306
  const config = {
293
307
  // ... other configuration settings
294
308
  editor: {
295
- // ... other configuration settings
296
-
297
309
  /**
298
- * Indicates if the application should hot reload the locale configurations when a change is detected.
299
- * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.
310
+ * Enables hot reloading of locale configurations when changes are detected.
311
+ * For example, when a dictionary is added or updated, the application updates
312
+ * the content displayed on the page.
300
313
  *
301
- * Because the hot reloading needs an continuous connection to the server, it is only available for clients of the `enterprise` plan
314
+ * Because hot reloading requires a continuous connection to the server, it is
315
+ * only available for clients of the `enterprise` plan.
302
316
  *
303
317
  * Default: false
304
318
  */
305
319
  liveSync: true,
306
320
  },
321
+ build: {
322
+ /**
323
+ * Controls how dictionaries are imported:
324
+ *
325
+ * - "live": Dictionaries are fetched dynamically using the Live Sync API.
326
+ * Replaces useIntlayer with useDictionaryDynamic.
327
+ *
328
+ * Note: Live mode uses the Live Sync API to fetch dictionaries. If the API call
329
+ * fails, dictionaries are imported dynamically.
330
+ * Note: Only dictionaries with remote content and "live" flags use live mode.
331
+ * Others use dynamic mode for performance.
332
+ */
333
+ importMode: "live",
334
+ },
307
335
  };
308
336
 
309
337
  export default config;
@@ -314,29 +342,182 @@ export default config;
314
342
  const config = {
315
343
  // ... other configuration settings
316
344
  editor: {
317
- // ... other configuration settings
318
-
319
345
  /**
320
- * Indicates if the application should hot reload the locale configurations when a change is detected.
321
- * For example, when a new dictionary is added or updated, the application will update the content tu display in the page.
346
+ * Enables hot reloading of locale configurations when changes are detected.
347
+ * For example, when a dictionary is added or updated, the application updates
348
+ * the content displayed on the page.
322
349
  *
323
- * Because the hot reloading needs an continuous connection to the server, it is only available for clients of the `enterprise` plan
350
+ * Because hot reloading requires a continuous connection to the server, it is
351
+ * only available for clients of the `enterprise` plan.
324
352
  *
325
353
  * Default: false
326
354
  */
327
355
  liveSync: true,
356
+
357
+ /**
358
+ * The port of the Live Sync server.
359
+ *
360
+ * Default: 4000
361
+ */
362
+ liveSyncPort: 4000,
363
+
364
+ /**
365
+ * The URL of the Live Sync server.
366
+ *
367
+ * Default: http://localhost:{liveSyncPort}
368
+ */
369
+ liveSyncURL: "https://live.example.com",
370
+ },
371
+ build: {
372
+ /**
373
+ * Controls how dictionaries are imported:
374
+ *
375
+ * - "live": Dictionaries are fetched dynamically using the Live Sync API.
376
+ * Replaces useIntlayer with useDictionaryDynamic.
377
+ *
378
+ * Note: Live mode uses the Live Sync API to fetch dictionaries. If the API call
379
+ * fails, dictionaries are imported dynamically.
380
+ * Note: Only dictionaries with remote content and "live" flags use live mode.
381
+ * Others use dynamic mode for performance.
382
+ */
383
+ importMode: "live",
384
+ },
385
+ };
386
+
387
+ module.exports = config;
388
+ ```
389
+
390
+ Start the Live Sync server to wrap your application:
391
+
392
+ Example using standalone server:
393
+
394
+ ```json5 fileName="package.json"
395
+ {
396
+ "scripts": {
397
+ // ... other scripts
398
+ "live:start": "npx intlayer live",
399
+ },
400
+ }
401
+ ```
402
+
403
+ You can also use your application server in parallel using the `--process` argument.
404
+
405
+ Example using Next.js:
406
+
407
+ ```json5 fileName="package.json"
408
+ {
409
+ "scripts": {
410
+ // ... other scripts
411
+ "build": "next build",
412
+ "dev": "next dev",
413
+ "start": "npx intlayer live --process 'next start'",
414
+ },
415
+ }
416
+ ```
417
+
418
+ Example using Vite:
419
+
420
+ ```json5 fileName="package.json"
421
+ {
422
+ "scripts": {
423
+ // ... other scripts
424
+ "build": "vite build",
425
+ "dev": "vite dev",
426
+ "start": "npx intlayer live --process 'vite start'",
427
+ },
428
+ }
429
+ ```
430
+
431
+ The Live Sync server wraps your application and automatically applies updated content as it arrives.
432
+
433
+ To receive change notifications from the CMS, the Live Sync server maintains an SSE connection to the backend. When content changes in the CMS, the backend forwards the update to the Live Sync server, which writes the new dictionaries. Your application will reflect the update on the next navigation or browser reload—no rebuild required.
434
+
435
+ Flow chart (CMS/Backend -> Live Sync Server -> Application Server -> Frontend):
436
+
437
+ ![Live Sync Flow CMS/Backend/Live Sync Server/Application Server/Frontend Schema](https://github.com/aymericzip/intlayer/blob/main/docs/assets/live_sync_flow_scema.svg)
438
+
439
+ How it works:
440
+
441
+ ![Live Sync Logic Schema](https://github.com/aymericzip/intlayer/blob/main/docs/assets/live_sync_logic_schema.svg)
442
+
443
+ ### Development workflow (local)
444
+
445
+ - In development, all remote dictionaries are fetched when the application starts, so you can test updates quickly.
446
+ - To test Live Sync locally with Next.js, wrap your dev server:
447
+
448
+ ```json5 fileName="package.json"
449
+ {
450
+ "scripts": {
451
+ // ... other scripts
452
+ "dev": "npx intlayer live --process 'next dev'",
453
+ // "dev": "npx intlayer live --process 'vite dev'", // For Vite
454
+ },
455
+ }
456
+ ```
457
+
458
+ Enable optimization so Intlayer applies the Live import transformations during development:
459
+
460
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
461
+ import type { IntlayerConfig } from "intlayer";
462
+
463
+ const config: IntlayerConfig = {
464
+ editor: {
465
+ applicationURL: "http://localhost:5173",
466
+ liveSyncURL: "http://localhost:4000",
467
+ liveSync: true,
468
+ },
469
+ build: {
470
+ optimize: true, // default: process.env.NODE_ENV === 'production'
471
+ importMode: "live",
472
+ },
473
+ };
474
+
475
+ export default config;
476
+ ```
477
+
478
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
479
+ /** @type {import('intlayer').IntlayerConfig} */
480
+ const config = {
481
+ editor: {
482
+ applicationURL: "http://localhost:5173",
483
+ liveSyncURL: "http://localhost:4000",
484
+ liveSync: true,
485
+ },
486
+ build: {
487
+ optimize: true, // default: process.env.NODE_ENV === 'production'
488
+ importMode: "live",
489
+ },
490
+ };
491
+
492
+ export default config;
493
+ ```
494
+
495
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
496
+ /** @type {import('intlayer').IntlayerConfig} */
497
+ const config = {
498
+ editor: {
499
+ applicationURL: "http://localhost:5173",
500
+ liveSyncURL: "http://localhost:4000",
501
+ liveSync: true,
502
+ },
503
+ build: {
504
+ optimize: true, // default: process.env.NODE_ENV === 'production'
505
+ importMode: "live",
328
506
  },
329
507
  };
330
508
 
331
509
  module.exports = config;
332
510
  ```
333
511
 
334
- The hot reloading replace the content in both server and client side.
512
+ This setup wraps your dev server with the Live Sync server, fetches remote dictionaries at startup, and streams updates from the CMS via SSE. Refresh the page to see changes.
335
513
 
336
- - On the server side, you should ensure that the application process has the write access to the `.intlayer/dictionaries` directory.
337
- - On the client side, the hot reloading allow the application to hot reload the content in the browser, without needing to reload the page. However, this feature is only available for clients components.
514
+ Notes and constraints:
338
515
 
339
- > Because the hot reloading needs an continuous connection to the server using an `EventListener`, it is only available for clients of the `enterprise` plan.
516
+ - Add the live sync origin to your site security policy (CSP). Ensure the live sync URL is allowed in `connect-src` (and `frame-ancestors` if relevant).
517
+ - Live Sync does not work with static output. For Next.js, the page must be dynamic to receive updates at runtime (e.g., use `generateStaticParams`, `generateMetadata`, `getServerSideProps`, or `getStaticProps` appropriately to avoid full static-only constraints).
518
+ - In the CMS, each dictionary has a `live` flag. Only dictionaries with `live=true` are fetched via the live sync API; others are imported dynamically and remain unchanged at runtime.
519
+ - The `live` flag is evaluated for each dictionary at build time. If remote content wasn't flagged `live=true` during build, you must rebuild to enable Live Sync for that dictionary.
520
+ - The live sync server must be able to write to `.intlayer`. In containers, ensure write access to `/.intlayer`.
340
521
 
341
522
  ## Debug
342
523
 
@@ -357,5 +538,6 @@ If you encounter any issues with the CMS, check the following:
357
538
 
358
539
  | Version | Date | Changes |
359
540
  | ------- | ---------- | --------------------------------------- |
541
+ | 6.0.1 | 2025-09-22 | Add live sync documentation |
360
542
  | 6.0.0 | 2025-09-04 | Replace `hotReload` field by `liveSync` |
361
543
  | 5.5.10 | 2025-06-29 | Init history |
@@ -441,11 +441,11 @@ npx intlayer configuration push
441
441
 
442
442
  By pushing the configuration, your project is fully integrated with the Intlayer CMS, enabling seamless dictionary management across teams.
443
443
 
444
- ### Documentation Management
444
+ ### Document Management
445
445
 
446
446
  The `doc` commands provide tools for managing and translating documentation files across multiple locales.
447
447
 
448
- #### Translate Documentation
448
+ #### Translate Document
449
449
 
450
450
  The `doc translate` command automatically translates documentation files from a base locale to target locales using AI translation services.
451
451
 
@@ -552,9 +552,9 @@ npx intlayer doc translate
552
552
  > - `{{baseLocale}}_` by `{{locale}}_`
553
553
  > - `.{{baseLocaleName}}.` by `.{{localeName}}.`
554
554
  >
555
- > If the pattern is not found, the output file will add the `.{{locale}}` at the extentions of the file. `./my/file.md` will be translated to `./my/file.fr.md` for the French locale.
555
+ > If the pattern is not found, the output file will add the `.{{locale}}` at the extensions of the file. `./my/file.md` will be translated to `./my/file.fr.md` for the French locale.
556
556
 
557
- #### Review Documentation
557
+ #### Review Document
558
558
 
559
559
  The `doc review` command analyzes documentation files for quality, consistency, and completeness across different locales.
560
560
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-08-23
3
- updatedAt: 2025-09-21
3
+ updatedAt: 2025-09-22
4
4
  title: Intlayer Visual Editor | Edit your content using a visual editor
5
5
  description: Discover how to use the Intlayer Editor to manage your multilingual website. Follow the steps in this online documentation to set up your project in a few minutes.
6
6
  keywords:
@@ -58,7 +58,7 @@ The visual editor in an application that includes two things:
58
58
 
59
59
  - Once you clicked the download button, the visual editor will send a request to the server to replace your content declaration files with the new content (wherever these files are declared in your project).
60
60
 
61
- > Note that for now, Intlayer Editor will write your content declaration files as JSON files.
61
+ > Note that Intlayer Editor will write your content declaration files as JSON if the file extension is `.json`. If the file extension is `.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, `.cjs`, it will write the file as a JavaScript file using a babel transformer.
62
62
 
63
63
  ## Installation
64
64
 
@@ -266,7 +266,8 @@ If you encounter any issues with the visual editor, check the following:
266
266
 
267
267
  ## Doc History
268
268
 
269
- | Version | Date | Changes |
270
- | ------- | ---------- | ---------------------- |
271
- | 6.0.0 | 2025-09-21 | Add reexported command |
272
- | 5.5.10 | 2025-06-29 | Init history |
269
+ | Version | Date | Changes |
270
+ | ------- | ---------- | -------------------------------------------------------------------- |
271
+ | 6.0.1 | 2025-09-22 | Change behavior of the editor when the file extension is not `.json` |
272
+ | 6.0.0 | 2025-09-21 | Add reexported command |
273
+ | 5.5.10 | 2025-06-29 | Init history |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-12-06
3
- updatedAt: 2025-06-29
3
+ updatedAt: 2025-09-22
4
4
  title: Translate your Next.js 14 and App Router website (i18n)
5
5
  description: Discover how to make your Next.js 14 App Router website multilingual. Follow the documentation to internationalize (i18n) and translate it.
6
6
  keywords:
@@ -180,6 +180,21 @@ module.exports = { middleware: intlayerMiddleware, config };
180
180
 
181
181
  > Adapt the `matcher` parameter to match the routes of your application. For more details, refer to the [Next.js documentation on configuring the matcher](https://nextjs.org/docs/app/building-your-application/routing/middleware).
182
182
 
183
+ > If you need to chain several middlewares together (for example, `intlayerMiddleware` with authentication or custom middlewares), Intlayer now provides a helper called `multipleMiddlewares`.
184
+
185
+ ```ts
186
+ import {
187
+ multipleMiddlewares,
188
+ intlayerMiddleware,
189
+ } from "next-intlayer/middleware";
190
+ import { customMiddleware } from "@utils/customMiddleware";
191
+
192
+ export const middleware = multipleMiddlewares([
193
+ intlayerMiddleware,
194
+ customMiddleware,
195
+ ]);
196
+ ```
197
+
183
198
  ### Step 5: Define Dynamic Locale Routes
184
199
 
185
200
  Remove everything from `RootLayout` and replace it with the following code:
@@ -1459,5 +1474,6 @@ To go further, you can implement the [visual editor](https://github.com/aymericz
1459
1474
 
1460
1475
  | Version | Date | Changes |
1461
1476
  | ------- | ---------- | --------------------------------------------------------------- |
1477
+ | 5.6.2 | 2025-09-22 | Added docs for `multipleMiddlewares` helper |
1462
1478
  | 5.6.0 | 2025-07-06 | Transform `withIntlayer()` function to a promise based function |
1463
1479
  | 5.5.10 | 2025-06-29 | Init history |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2024-12-06
3
- updatedAt: 2025-06-29
3
+ updatedAt: 2025-09-22
4
4
  title: Translate your Next.js 15 website (i18n)
5
5
  description: Discover how to make your Next.js 15 website multilingual. Follow the documentation to internationalize (i18n) and translate it.
6
6
  keywords:
@@ -638,6 +638,21 @@ module.exports = { middleware: intlayerMiddleware, config };
638
638
 
639
639
  > The `intlayerMiddleware` is used to detect the user's preferred locale and redirect them to the appropriate URL as specified in the [configuration](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/configuration.md). Additionally, it enables saving the user's preferred locale in a cookie.
640
640
 
641
+ > If you need to chain several middlewares together (for example, `intlayerMiddleware` with authentication or custom middlewares), Intlayer now provides a helper called `multipleMiddlewares`.
642
+
643
+ ```ts
644
+ import {
645
+ multipleMiddlewares,
646
+ intlayerMiddleware,
647
+ } from "next-intlayer/middleware";
648
+ import { customMiddleware } from "@utils/customMiddleware";
649
+
650
+ export const middleware = multipleMiddlewares([
651
+ intlayerMiddleware,
652
+ customMiddleware,
653
+ ]);
654
+ ```
655
+
641
656
  ### (Optional) Step 8: Internationalization of your metadata
642
657
 
643
658
  In the case you want to internationalize your metadata, such as the title of your page, you can use the `generateMetadata` function provided by Next.js. Inside, you can retrieve the content from the `getIntlayer` function to translate your metadata.
@@ -1504,5 +1519,6 @@ To go further, you can implement the [visual editor](https://github.com/aymericz
1504
1519
 
1505
1520
  | Version | Date | Changes |
1506
1521
  | ------- | ---------- | --------------------------------------------------------------- |
1522
+ | 5.6.2 | 2025-09-22 | Added docs for `multipleMiddlewares` helper |
1507
1523
  | 5.6.0 | 2025-07-06 | Transform `withIntlayer()` function to a promise based function |
1508
1524
  | 5.5.10 | 2025-06-29 | Init history |