@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.
- package/docs/ar/compiler.md +84 -49
- package/docs/ar/configuration.md +80 -37
- package/docs/ar/intlayer_with_nextjs_16.md +174 -1
- package/docs/ar/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ar/intlayer_with_react_router_v7.md +224 -1
- package/docs/ar/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ar/intlayer_with_svelte_kit.md +175 -2
- package/docs/ar/intlayer_with_tanstack.md +176 -1
- package/docs/ar/intlayer_with_vite+preact.md +174 -1
- package/docs/ar/intlayer_with_vite+react.md +174 -1
- package/docs/ar/intlayer_with_vite+solid.md +174 -1
- package/docs/ar/intlayer_with_vite+svelte.md +174 -1
- package/docs/ar/intlayer_with_vite+vue.md +174 -1
- package/docs/de/compiler.md +83 -48
- package/docs/de/configuration.md +434 -212
- package/docs/de/intlayer_with_nextjs_16.md +176 -1
- package/docs/de/intlayer_with_nextjs_compiler.md +106 -349
- package/docs/de/intlayer_with_react_router_v7.md +225 -2
- package/docs/de/intlayer_with_react_router_v7_fs_routes.md +221 -79
- package/docs/de/intlayer_with_svelte_kit.md +158 -2
- package/docs/de/intlayer_with_tanstack.md +159 -1
- package/docs/de/intlayer_with_vite+preact.md +157 -1
- package/docs/de/intlayer_with_vite+react.md +157 -1
- package/docs/de/intlayer_with_vite+solid.md +159 -3
- package/docs/de/intlayer_with_vite+svelte.md +157 -1
- package/docs/de/intlayer_with_vite+vue.md +157 -1
- package/docs/en/compiler.md +60 -33
- package/docs/en/configuration.md +80 -57
- package/docs/en/intlayer_with_nextjs_16.md +176 -0
- package/docs/en/intlayer_with_nextjs_compiler.md +179 -1
- package/docs/en/intlayer_with_react_router_v7.md +159 -0
- package/docs/en/intlayer_with_react_router_v7_fs_routes.md +159 -0
- package/docs/en/intlayer_with_svelte_kit.md +159 -0
- package/docs/en/intlayer_with_tanstack.md +160 -1
- package/docs/en/intlayer_with_vite+preact.md +159 -0
- package/docs/en/intlayer_with_vite+react.md +159 -0
- package/docs/en/intlayer_with_vite+solid.md +148 -27
- package/docs/en/intlayer_with_vite+svelte.md +159 -0
- package/docs/en/intlayer_with_vite+vue.md +142 -41
- package/docs/en-GB/compiler.md +66 -34
- package/docs/en-GB/configuration.md +78 -36
- package/docs/es/compiler.md +83 -48
- package/docs/es/configuration.md +429 -206
- package/docs/es/intlayer_with_adonisjs.md +1 -1
- package/docs/es/intlayer_with_express.md +1 -1
- package/docs/es/intlayer_with_fastify.md +1 -1
- package/docs/es/intlayer_with_hono.md +1 -1
- package/docs/es/intlayer_with_nestjs.md +1 -1
- package/docs/es/intlayer_with_nextjs_16.md +176 -3
- package/docs/es/intlayer_with_nextjs_compiler.md +175 -2
- package/docs/es/intlayer_with_nuxt.md +1 -1
- package/docs/es/intlayer_with_react_router_v7.md +227 -4
- package/docs/es/intlayer_with_react_router_v7_fs_routes.md +162 -4
- package/docs/es/intlayer_with_svelte_kit.md +158 -2
- package/docs/es/intlayer_with_tanstack.md +160 -2
- package/docs/es/intlayer_with_vite+preact.md +162 -6
- package/docs/es/intlayer_with_vite+react.md +160 -4
- package/docs/es/intlayer_with_vite+solid.md +163 -7
- package/docs/es/intlayer_with_vite+svelte.md +157 -1
- package/docs/es/intlayer_with_vite+vue.md +165 -9
- package/docs/fr/compiler.md +81 -46
- package/docs/fr/configuration.md +355 -134
- package/docs/fr/intlayer_with_adonisjs.md +1 -1
- package/docs/fr/intlayer_with_express.md +1 -1
- package/docs/fr/intlayer_with_fastify.md +1 -1
- package/docs/fr/intlayer_with_hono.md +1 -1
- package/docs/fr/intlayer_with_nestjs.md +1 -1
- package/docs/fr/intlayer_with_nextjs_16.md +183 -7
- package/docs/fr/intlayer_with_nextjs_compiler.md +179 -3
- package/docs/fr/intlayer_with_react_router_v7.md +229 -3
- package/docs/fr/intlayer_with_react_router_v7_fs_routes.md +237 -6
- package/docs/fr/intlayer_with_svelte_kit.md +158 -2
- package/docs/fr/intlayer_with_tanstack.md +159 -1
- package/docs/fr/intlayer_with_vite+preact.md +164 -8
- package/docs/fr/intlayer_with_vite+react.md +162 -6
- package/docs/fr/intlayer_with_vite+solid.md +163 -7
- package/docs/fr/intlayer_with_vite+svelte.md +157 -1
- package/docs/fr/intlayer_with_vite+vue.md +164 -8
- package/docs/hi/compiler.md +81 -46
- package/docs/hi/configuration.md +87 -44
- package/docs/hi/intlayer_with_nextjs_16.md +174 -1
- package/docs/hi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/hi/intlayer_with_react_router_v7.md +224 -1
- package/docs/hi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/hi/intlayer_with_svelte_kit.md +158 -2
- package/docs/hi/intlayer_with_tanstack.md +159 -1
- package/docs/hi/intlayer_with_vite+preact.md +157 -1
- package/docs/hi/intlayer_with_vite+react.md +157 -1
- package/docs/hi/intlayer_with_vite+solid.md +157 -1
- package/docs/hi/intlayer_with_vite+svelte.md +157 -1
- package/docs/hi/intlayer_with_vite+vue.md +157 -1
- package/docs/id/compiler.md +84 -51
- package/docs/id/configuration.md +83 -45
- package/docs/id/intlayer_with_nextjs_16.md +174 -1
- package/docs/id/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/id/intlayer_with_react_router_v7.md +224 -1
- package/docs/id/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/id/intlayer_with_svelte_kit.md +158 -2
- package/docs/id/intlayer_with_tanstack.md +159 -1
- package/docs/id/intlayer_with_vite+preact.md +157 -1
- package/docs/id/intlayer_with_vite+react.md +157 -1
- package/docs/id/intlayer_with_vite+solid.md +157 -1
- package/docs/id/intlayer_with_vite+svelte.md +157 -1
- package/docs/id/intlayer_with_vite+vue.md +157 -1
- package/docs/it/compiler.md +81 -46
- package/docs/it/configuration.md +426 -204
- package/docs/it/intlayer_with_nextjs_16.md +174 -1
- package/docs/it/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/it/intlayer_with_react_router_v7.md +225 -2
- package/docs/it/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/it/intlayer_with_svelte_kit.md +158 -2
- package/docs/it/intlayer_with_tanstack.md +159 -1
- package/docs/it/intlayer_with_vite+preact.md +157 -1
- package/docs/it/intlayer_with_vite+react.md +157 -1
- package/docs/it/intlayer_with_vite+solid.md +159 -3
- package/docs/it/intlayer_with_vite+svelte.md +157 -1
- package/docs/it/intlayer_with_vite+vue.md +157 -1
- package/docs/ja/compiler.md +94 -58
- package/docs/ja/configuration.md +88 -45
- package/docs/ja/intlayer_with_nextjs_16.md +174 -1
- package/docs/ja/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ja/intlayer_with_react_router_v7.md +184 -394
- package/docs/ja/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ja/intlayer_with_svelte_kit.md +119 -595
- package/docs/ja/intlayer_with_tanstack.md +131 -642
- package/docs/ja/intlayer_with_vite+preact.md +111 -1231
- package/docs/ja/intlayer_with_vite+react.md +129 -1304
- package/docs/ja/intlayer_with_vite+solid.md +159 -3
- package/docs/ja/intlayer_with_vite+svelte.md +157 -1
- package/docs/ja/intlayer_with_vite+vue.md +157 -1
- package/docs/ko/compiler.md +88 -52
- package/docs/ko/configuration.md +87 -44
- package/docs/ko/intlayer_with_nextjs_16.md +174 -1
- package/docs/ko/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ko/intlayer_with_react_router_v7.md +225 -2
- package/docs/ko/intlayer_with_react_router_v7_fs_routes.md +226 -2
- package/docs/ko/intlayer_with_svelte_kit.md +158 -2
- package/docs/ko/intlayer_with_tanstack.md +159 -1
- package/docs/ko/intlayer_with_vite+preact.md +157 -1
- package/docs/ko/intlayer_with_vite+react.md +157 -1
- package/docs/ko/intlayer_with_vite+solid.md +159 -3
- package/docs/ko/intlayer_with_vite+svelte.md +157 -1
- package/docs/ko/intlayer_with_vite+vue.md +157 -1
- package/docs/pl/compiler.md +84 -51
- package/docs/pl/configuration.md +83 -37
- package/docs/pl/intlayer_with_nextjs_16.md +174 -1
- package/docs/pl/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pl/intlayer_with_react_router_v7.md +224 -1
- package/docs/pl/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pl/intlayer_with_svelte_kit.md +158 -2
- package/docs/pl/intlayer_with_tanstack.md +159 -1
- package/docs/pl/intlayer_with_vite+preact.md +157 -1
- package/docs/pl/intlayer_with_vite+react.md +157 -1
- package/docs/pl/intlayer_with_vite+solid.md +157 -1
- package/docs/pl/intlayer_with_vite+svelte.md +157 -1
- package/docs/pl/intlayer_with_vite+vue.md +157 -1
- package/docs/pt/compiler.md +81 -46
- package/docs/pt/configuration.md +404 -194
- package/docs/pt/intlayer_with_nextjs_16.md +174 -1
- package/docs/pt/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/pt/intlayer_with_react_router_v7.md +224 -1
- package/docs/pt/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/pt/intlayer_with_svelte_kit.md +158 -2
- package/docs/pt/intlayer_with_tanstack.md +159 -1
- package/docs/pt/intlayer_with_vite+preact.md +157 -1
- package/docs/pt/intlayer_with_vite+react.md +157 -1
- package/docs/pt/intlayer_with_vite+solid.md +157 -1
- package/docs/pt/intlayer_with_vite+svelte.md +157 -1
- package/docs/pt/intlayer_with_vite+vue.md +157 -1
- package/docs/ru/compiler.md +90 -57
- package/docs/ru/configuration.md +76 -46
- package/docs/ru/intlayer_with_nextjs_16.md +174 -1
- package/docs/ru/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/ru/intlayer_with_react_router_v7.md +224 -1
- package/docs/ru/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/ru/intlayer_with_svelte_kit.md +158 -2
- package/docs/ru/intlayer_with_tanstack.md +159 -1
- package/docs/ru/intlayer_with_vite+preact.md +157 -1
- package/docs/ru/intlayer_with_vite+react.md +157 -1
- package/docs/ru/intlayer_with_vite+solid.md +157 -1
- package/docs/ru/intlayer_with_vite+svelte.md +157 -1
- package/docs/ru/intlayer_with_vite+vue.md +157 -1
- package/docs/tr/compiler.md +85 -52
- package/docs/tr/configuration.md +83 -40
- package/docs/tr/intlayer_with_nextjs_16.md +174 -1
- package/docs/tr/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/tr/intlayer_with_react_router_v7.md +224 -1
- package/docs/tr/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/tr/intlayer_with_svelte_kit.md +158 -2
- package/docs/tr/intlayer_with_tanstack.md +159 -1
- package/docs/tr/intlayer_with_vite+preact.md +157 -1
- package/docs/tr/intlayer_with_vite+react.md +157 -1
- package/docs/tr/intlayer_with_vite+solid.md +157 -1
- package/docs/tr/intlayer_with_vite+svelte.md +157 -1
- package/docs/tr/intlayer_with_vite+vue.md +157 -1
- package/docs/uk/compiler.md +96 -61
- package/docs/uk/configuration.md +83 -37
- package/docs/uk/intlayer_with_nextjs_16.md +174 -1
- package/docs/uk/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/uk/intlayer_with_react_router_v7.md +224 -1
- package/docs/uk/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/uk/intlayer_with_svelte_kit.md +157 -1
- package/docs/uk/intlayer_with_tanstack.md +159 -1
- package/docs/uk/intlayer_with_vite+preact.md +157 -1
- package/docs/uk/intlayer_with_vite+react.md +157 -1
- package/docs/uk/intlayer_with_vite+solid.md +157 -1
- package/docs/uk/intlayer_with_vite+svelte.md +157 -1
- package/docs/uk/intlayer_with_vite+vue.md +157 -1
- package/docs/vi/compiler.md +85 -50
- package/docs/vi/configuration.md +85 -39
- package/docs/vi/intlayer_with_nextjs_16.md +174 -1
- package/docs/vi/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/vi/intlayer_with_react_router_v7.md +224 -1
- package/docs/vi/intlayer_with_react_router_v7_fs_routes.md +225 -1
- package/docs/vi/intlayer_with_svelte_kit.md +158 -2
- package/docs/vi/intlayer_with_tanstack.md +159 -1
- package/docs/vi/intlayer_with_vite+preact.md +157 -1
- package/docs/vi/intlayer_with_vite+react.md +157 -1
- package/docs/vi/intlayer_with_vite+solid.md +157 -1
- package/docs/vi/intlayer_with_vite+svelte.md +157 -1
- package/docs/vi/intlayer_with_vite+vue.md +157 -1
- package/docs/zh/compiler.md +84 -49
- package/docs/zh/configuration.md +80 -37
- package/docs/zh/intlayer_with_adonisjs.md +1 -1
- package/docs/zh/intlayer_with_express.md +1 -1
- package/docs/zh/intlayer_with_fastify.md +1 -1
- package/docs/zh/intlayer_with_hono.md +1 -1
- package/docs/zh/intlayer_with_nestjs.md +1 -1
- package/docs/zh/intlayer_with_nextjs_16.md +174 -1
- package/docs/zh/intlayer_with_nextjs_compiler.md +174 -1
- package/docs/zh/intlayer_with_react_router_v7.md +227 -4
- package/docs/zh/intlayer_with_react_router_v7_fs_routes.md +228 -4
- package/docs/zh/intlayer_with_svelte_kit.md +158 -2
- package/docs/zh/intlayer_with_tanstack.md +159 -1
- package/docs/zh/intlayer_with_vite+preact.md +159 -3
- package/docs/zh/intlayer_with_vite+react.md +157 -1
- package/docs/zh/intlayer_with_vite+solid.md +161 -5
- package/docs/zh/intlayer_with_vite+svelte.md +157 -1
- package/docs/zh/intlayer_with_vite+vue.md +158 -2
- package/package.json +6 -6
package/docs/vi/configuration.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-13
|
|
3
|
-
updatedAt: 2026-03-
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Cấu hình
|
|
5
5
|
description: Tìm hiểu cách cấu hình Intlayer cho ứng dụng của bạn. Hiểu các thiết lập và tùy chọn khác nhau để tùy chỉnh Intlayer theo nhu cầu của bạn.
|
|
6
6
|
keywords:
|
|
@@ -15,7 +15,7 @@ slugs:
|
|
|
15
15
|
- configuration
|
|
16
16
|
history:
|
|
17
17
|
- version: 8.3.0
|
|
18
|
-
|
|
18
|
+
date: 2026-03-11
|
|
19
19
|
changes: Di chuyển 'baseDir' từ cấu hình 'content' sang cấu hình 'system'
|
|
20
20
|
- version: 8.2.0
|
|
21
21
|
date: 2026-03-09
|
|
@@ -110,7 +110,7 @@ Intlayer chấp nhận các định dạng tệp cấu hình JSON, JS, MJS và T
|
|
|
110
110
|
|
|
111
111
|
## Ví dụ tệp cấu hình
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
````typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
114
114
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
115
115
|
import { nextjsRewrite } from "intlayer/routing";
|
|
116
116
|
import { z } from "zod";
|
|
@@ -208,7 +208,7 @@ const config: IntlayerConfig = {
|
|
|
208
208
|
* Options: 'cookie', 'localStorage', 'sessionStorage', 'header', or an array of these.
|
|
209
209
|
* Default: ['cookie', 'header']
|
|
210
210
|
*/
|
|
211
|
-
storage: "cookie",
|
|
211
|
+
storage: ["cookie", "header"],
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
214
|
* Base path for the application URLs.
|
|
@@ -345,6 +345,17 @@ const config: IntlayerConfig = {
|
|
|
345
345
|
* Base URL for the AI API.
|
|
346
346
|
*/
|
|
347
347
|
baseURL: "http://localhost:3000",
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Tuần tự hóa dữ liệu
|
|
351
|
+
*
|
|
352
|
+
* Tùy chọn:
|
|
353
|
+
* - "json": Tiêu chuẩn, đáng tin cậy; tiêu tốn nhiều token hơn.
|
|
354
|
+
* - "toon": Ít token hơn, kém nhất quán hơn JSON.
|
|
355
|
+
*
|
|
356
|
+
* Mặc định: "json"
|
|
357
|
+
*/
|
|
358
|
+
dataSerialization: "json",
|
|
348
359
|
},
|
|
349
360
|
|
|
350
361
|
/**
|
|
@@ -444,42 +455,70 @@ const config: IntlayerConfig = {
|
|
|
444
455
|
compiler: {
|
|
445
456
|
/**
|
|
446
457
|
* Cho biết trình biên dịch có nên được bật hay không.
|
|
458
|
+
*
|
|
459
|
+
* - false : Vô hiệu hóa trình biên dịch.
|
|
460
|
+
* - true : Kích hoạt trình biên dịch.
|
|
461
|
+
* - "build-only" : Bỏ qua trình biên dịch trong quá trình phát triển để tăng tốc thời gian khởi động.
|
|
462
|
+
*
|
|
463
|
+
* Giá trị mặc định : false
|
|
447
464
|
*/
|
|
448
465
|
enabled: true,
|
|
449
466
|
|
|
450
467
|
/**
|
|
451
|
-
*
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
*
|
|
468
|
+
* Xác định đường dẫn tệp đầu ra. Thay thế `outputDir`.
|
|
469
|
+
*
|
|
470
|
+
* - Các đường dẫn bắt đầu bằng `./` được giải quyết tương đối so với thư mục component.
|
|
471
|
+
* - Các đường dẫn bắt đầu bằng `/` được giải quyết tương đối so với thư mục gốc của dự án (`baseDir`).
|
|
472
|
+
*
|
|
473
|
+
* - Việc bao gồm biến `{{locale}}` trong đường dẫn sẽ cho phép tạo các từ điển được tách biệt theo ngôn ngữ.
|
|
474
|
+
*
|
|
475
|
+
* Ví dụ:
|
|
476
|
+
* ```ts
|
|
477
|
+
* {
|
|
478
|
+
* // Tạo tệp .content.ts đa ngôn ngữ bên cạnh component
|
|
479
|
+
* output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
480
|
+
*
|
|
481
|
+
* // output: './{{fileName}}{{extension}}', // Cách viết tương đương bằng template string
|
|
482
|
+
* }
|
|
483
|
+
* ```
|
|
484
|
+
*
|
|
485
|
+
* ```ts
|
|
486
|
+
* {
|
|
487
|
+
* // Tạo tệp JSON tập trung theo ngôn ngữ trong thư mục gốc của dự án
|
|
488
|
+
* output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,
|
|
489
|
+
*
|
|
490
|
+
* // output: '/locales/{{locale}}/{{key}}.content.json', // Cách viết tương đương bằng template string
|
|
491
|
+
* }
|
|
492
|
+
* ```
|
|
493
|
+
*
|
|
494
|
+
* Danh sách biến:
|
|
495
|
+
* - `fileName`: Tên tệp.
|
|
496
|
+
* - `key`: Khóa nội dung.
|
|
497
|
+
* - `locale`: Ngôn ngữ nội dung.
|
|
498
|
+
* - `extension`: Phần mở rộng tệp.
|
|
499
|
+
* - `componentFileName`: Tên tệp component.
|
|
500
|
+
* - `componentExtension`: Phần mở rộng tệp component.
|
|
501
|
+
* - `format`: Định dạng từ điển.
|
|
502
|
+
* - `componentFormat`: Định dạng từ điển component.
|
|
503
|
+
* - `componentDirPath`: Đường dẫn thư mục component.
|
|
460
504
|
*/
|
|
461
|
-
|
|
505
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
462
506
|
|
|
463
507
|
/**
|
|
464
|
-
*
|
|
508
|
+
* Cho biết liệu các thành phần có nên được lưu sau khi được chuyển đổi hay không.
|
|
509
|
+
* Bằng cách đó, trình biên dịch có thể được chạy một lần duy nhất để chuyển đổi ứng dụng, và sau đó nó có thể được gỡ bỏ.
|
|
465
510
|
*/
|
|
466
|
-
|
|
511
|
+
saveComponents: false,
|
|
467
512
|
|
|
468
513
|
/**
|
|
469
|
-
* Chỉ chèn nội dung vào tệp đã tạo
|
|
514
|
+
* Chỉ chèn nội dung vào tệp đã tạo. Hữu ích cho đầu ra JSON i18next hoặc ICU MessageFormat theo từng ngôn ngữ.
|
|
470
515
|
*/
|
|
471
516
|
noMetadata: false,
|
|
472
517
|
|
|
473
518
|
/**
|
|
474
519
|
* Tiền tố khóa từ điển
|
|
475
520
|
*/
|
|
476
|
-
dictionaryKeyPrefix: "", //
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* Cho biết liệu các thành phần có nên được lưu sau khi được chuyển đổi hay không.
|
|
480
|
-
* Bằng cách đó, trình biên dịch có thể được chạy một lần duy nhất để chuyển đổi ứng dụng, và sau đó nó có thể được gỡ bỏ.
|
|
481
|
-
*/
|
|
482
|
-
saveComponents: false,
|
|
521
|
+
dictionaryKeyPrefix: "", // Thêm tiền tố tùy chọn cho các khóa từ điển được trích xuất
|
|
483
522
|
},
|
|
484
523
|
|
|
485
524
|
/**
|
|
@@ -498,7 +537,7 @@ const config: IntlayerConfig = {
|
|
|
498
537
|
};
|
|
499
538
|
|
|
500
539
|
export default config;
|
|
501
|
-
|
|
540
|
+
````
|
|
502
541
|
|
|
503
542
|
## Tham chiếu Cấu hình
|
|
504
543
|
|
|
@@ -1177,7 +1216,7 @@ Các cài đặt kiểm soát trình biên dịch Intlayer, trình biên dịch
|
|
|
1177
1216
|
|
|
1178
1217
|
- **dictionaryKeyPrefix**:
|
|
1179
1218
|
- _Kiểu_: `string`
|
|
1180
|
-
- _Mặc định_: `'
|
|
1219
|
+
- _Mặc định_: `''`
|
|
1181
1220
|
- _Mô tả_: Tiền tố cho các khóa từ điển được trích xuất.
|
|
1182
1221
|
- _Ví dụ_: `'my-key-'`
|
|
1183
1222
|
- _Lưu ý_: Khi từ điển được trích xuất, khóa được tạo dựa trên tên tệp. Tiền tố này được thêm vào khóa đã tạo để ngăn chặn xung đột.
|
|
@@ -1201,30 +1240,37 @@ Các cài đặt kiểm soát trình biên dịch Intlayer, trình biên dịch
|
|
|
1201
1240
|
- _Mô tả_: Các mẫu xác định những tệp nào sẽ bị loại trừ trong quá trình tối ưu hóa.
|
|
1202
1241
|
- _Ví dụ_: `['**/node_modules/**', '!**/node_modules/react/**']`
|
|
1203
1242
|
|
|
1204
|
-
- **outputDir**:
|
|
1205
|
-
- _Kiểu_: `string`
|
|
1206
|
-
- _Mặc định_: `'compiler'`
|
|
1207
|
-
- _Mô tả_: Thư mục nơi các từ điển trích xuất sẽ được lưu trữ, tương đối so với đường dẫn gốc dự án của bạn.
|
|
1208
|
-
|
|
1209
1243
|
- **output**:
|
|
1210
|
-
-
|
|
1211
|
-
- _Mặc định_: `
|
|
1212
|
-
- _Mô tả_: Xác định đường dẫn tệp đầu ra. Thay thế `outputDir`.
|
|
1213
|
-
-
|
|
1214
|
-
-
|
|
1244
|
+
- _Kiểu_: `FilePathPattern`
|
|
1245
|
+
- _Mặc định_: `undefined`
|
|
1246
|
+
- _Mô tả_: Xác định đường dẫn tệp đầu ra. Thay thế `outputDir`. Hỗ trợ các biến động thông qua template string hoặc hàm. Các biến được hỗ trợ: `{{fileName}}`, `{{key}}`, `{{locale}}`, `{{extension}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{format}}`, `{{componentFormat}}`, và `{{componentDirPath}}`.
|
|
1247
|
+
- _Lưu ý_: Các đường dẫn bắt đầu bằng `./` được giải quyết tương đối so với thư mục component. Các đường dẫn bắt đầu bằng `/` được giải quyết tương đối so với thư mục gốc của dự án (`baseDir`).
|
|
1248
|
+
- _Lưu ý_: Việc bao gồm biến `{{locale}}` trong đường dẫn sẽ cho phép tạo các từ điển được tách biệt theo ngôn ngữ.
|
|
1249
|
+
- _Ví dụ_:
|
|
1250
|
+
- **Tạo các tệp đa ngôn ngữ bên cạnh component**:
|
|
1251
|
+
- Chuỗi: `'./{{fileName}}{{extension}}'`
|
|
1252
|
+
- Hàm: `({ fileName, extension }) => \`./${fileName}${extension}\``
|
|
1253
|
+
|
|
1254
|
+
- **Xuất các tệp JSON tập trung cho mỗi ngôn ngữ**:
|
|
1255
|
+
- Chuỗi: `'/locales/{{locale}}/{{key}}.content.json'`
|
|
1256
|
+
- Hàm: `({ key, locale }) => \`/locales/${locale}/${key}.content.json\``
|
|
1215
1257
|
|
|
1216
1258
|
- **noMetadata**:
|
|
1217
|
-
-
|
|
1259
|
+
- _Kiểu_: `boolean`
|
|
1218
1260
|
- _Mặc định_: `false`
|
|
1219
|
-
- _Mô tả_: Cho biết liệu siêu dữ liệu có nên được lưu trong tệp hay không. Nếu true, trình biên dịch sẽ không lưu siêu dữ liệu của từ điển (khóa, trình bao bọc nội dung).
|
|
1261
|
+
- _Mô tả_: Cho biết liệu siêu dữ liệu có nên được lưu trong tệp hay không. Nếu true, trình biên dịch sẽ không lưu siêu dữ liệu của từ điển (khóa, trình bao bọc nội dung). Hữu ích cho đầu ra JSON i18next hoặc ICU MessageFormat cho mỗi ngôn ngữ.
|
|
1220
1262
|
- _Ghi chú_: Hữu ích nếu được sử dụng với plugin `loadJSON`.
|
|
1221
|
-
- _Ví dụ_:
|
|
1263
|
+
- _Ví dụ_:
|
|
1264
|
+
Nếu `true` :
|
|
1265
|
+
|
|
1222
1266
|
```json
|
|
1223
1267
|
{
|
|
1224
1268
|
"key": "value"
|
|
1225
1269
|
}
|
|
1226
1270
|
```
|
|
1271
|
+
|
|
1227
1272
|
Nếu `false`:
|
|
1273
|
+
|
|
1228
1274
|
```json
|
|
1229
1275
|
{
|
|
1230
1276
|
"key": "value",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-12-06
|
|
3
|
-
updatedAt:
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Next.js i18n - Cách dịch ứng dụng Next.js 16 năm 2026
|
|
5
5
|
description: Khám phá cách làm cho trang web Next.js 16 của bạn đa ngôn ngữ. Theo dõi tài liệu để quốc tế hóa (i18n) và dịch nó.
|
|
6
6
|
keywords:
|
|
@@ -1695,6 +1695,179 @@ Tiện ích mở rộng này cung cấp:
|
|
|
1695
1695
|
|
|
1696
1696
|
Để biết thêm chi tiết về cách sử dụng tiện ích mở rộng, hãy tham khảo [tài liệu Tiện ích mở rộng Intlayer VS Code](https://intlayer.org/doc/vs-code-extension).
|
|
1697
1697
|
|
|
1698
|
+
### (Tùy chọn) Bước 1 : Trích xuất nội dung các thành phần của bạn
|
|
1699
|
+
|
|
1700
|
+
Nếu bạn có một cơ sở mã hiện có, việc chuyển đổi hàng nghìn tệp có thể tốn nhiều thời gian.
|
|
1701
|
+
|
|
1702
|
+
Để đơn giản hóa quy trình này, Intlayer đề xuất một [trình biên dịch](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/compiler.md) / [trình trích xuất](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/cli/extract.md) để chuyển đổi các thành phần của bạn và trích xuất nội dung.
|
|
1703
|
+
|
|
1704
|
+
Để thiết lập, bạn có thể thêm phần `compiler` vào tệp `intlayer.config.ts` của mình:
|
|
1705
|
+
|
|
1706
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
1707
|
+
import { type IntlayerConfig } from "intlayer";
|
|
1708
|
+
|
|
1709
|
+
const config: IntlayerConfig = {
|
|
1710
|
+
// ... Phần còn lại của cấu hình
|
|
1711
|
+
compiler: {
|
|
1712
|
+
/**
|
|
1713
|
+
* Cho biết trình biên dịch có nên được bật hay không.
|
|
1714
|
+
*/
|
|
1715
|
+
enabled: true,
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* Xác định đường dẫn các tệp đầu ra
|
|
1719
|
+
*/
|
|
1720
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* Cho biết các thành phần có nên được lưu sau khi chuyển đổi hay không. Bằng cách đó, trình biên dịch có thể được chạy chỉ một lần để chuyển đổi ứng dụng, sau đó có thể được gỡ bỏ.
|
|
1724
|
+
*/
|
|
1725
|
+
saveComponents: false,
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* Tiền tố khóa từ điển
|
|
1729
|
+
*/
|
|
1730
|
+
dictionaryKeyPrefix: "",
|
|
1731
|
+
},
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1734
|
+
export default config;
|
|
1735
|
+
```
|
|
1736
|
+
|
|
1737
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
1738
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1739
|
+
const config = {
|
|
1740
|
+
// ... Phần còn lại của cấu hình
|
|
1741
|
+
compiler: {
|
|
1742
|
+
/**
|
|
1743
|
+
* Cho biết trình biên dịch có nên được bật hay không.
|
|
1744
|
+
*/
|
|
1745
|
+
enabled: true,
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* Xác định đường dẫn các tệp đầu ra
|
|
1749
|
+
*/
|
|
1750
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* Cho biết các thành phần có nên được lưu sau khi chuyển đổi hay không. Bằng cách đó, trình biên dịch có thể được chạy chỉ một lần để chuyển đổi ứng dụng, sau đó có thể được gỡ bỏ.
|
|
1754
|
+
*/
|
|
1755
|
+
saveComponents: false,
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Tiền tố khóa từ điển
|
|
1759
|
+
*/
|
|
1760
|
+
dictionaryKeyPrefix: "",
|
|
1761
|
+
},
|
|
1762
|
+
};
|
|
1763
|
+
|
|
1764
|
+
export default config;
|
|
1765
|
+
```
|
|
1766
|
+
|
|
1767
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
1768
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1769
|
+
const config = {
|
|
1770
|
+
// ... Phần còn lại của cấu hình
|
|
1771
|
+
compiler: {
|
|
1772
|
+
/**
|
|
1773
|
+
* Cho biết trình biên dịch có nên được bật hay không.
|
|
1774
|
+
*/
|
|
1775
|
+
enabled: true,
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Xác định đường dẫn các tệp đầu ra
|
|
1779
|
+
*/
|
|
1780
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1781
|
+
|
|
1782
|
+
/**
|
|
1783
|
+
* Cho biết các thành phần có nên được lưu sau khi chuyển đổi hay không. Bằng cách đó, trình biên dịch có thể được chạy chỉ một lần để chuyển đổi ứng dụng, sau đó có thể được gỡ bỏ.
|
|
1784
|
+
*/
|
|
1785
|
+
saveComponents: false,
|
|
1786
|
+
|
|
1787
|
+
/**
|
|
1788
|
+
* Tiền tố khóa từ điển
|
|
1789
|
+
*/
|
|
1790
|
+
dictionaryKeyPrefix: "",
|
|
1791
|
+
},
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
module.exports = config;
|
|
1795
|
+
```
|
|
1796
|
+
|
|
1797
|
+
<Tabs>
|
|
1798
|
+
<Tab value='Lệnh trích xuất'>
|
|
1799
|
+
|
|
1800
|
+
Chạy trình trích xuất để chuyển đổi các thành phần và trích xuất nội dung
|
|
1801
|
+
|
|
1802
|
+
```bash packageManager="npm"
|
|
1803
|
+
npx intlayer extract
|
|
1804
|
+
```
|
|
1805
|
+
|
|
1806
|
+
```bash packageManager="pnpm"
|
|
1807
|
+
pnpm intlayer extract
|
|
1808
|
+
```
|
|
1809
|
+
|
|
1810
|
+
```bash packageManager="yarn"
|
|
1811
|
+
yarn intlayer extract
|
|
1812
|
+
```
|
|
1813
|
+
|
|
1814
|
+
```bash packageManager="bun"
|
|
1815
|
+
bunx intlayer extract
|
|
1816
|
+
```
|
|
1817
|
+
|
|
1818
|
+
</Tab>
|
|
1819
|
+
<Tab value='Trình biên dịch Babel'>
|
|
1820
|
+
|
|
1821
|
+
```bash packageManager="npm"
|
|
1822
|
+
npm install @intlayer/babel --save-dev
|
|
1823
|
+
```
|
|
1824
|
+
|
|
1825
|
+
```bash packageManager="pnpm"
|
|
1826
|
+
pnpm add @intlayer/babel --save-dev
|
|
1827
|
+
```
|
|
1828
|
+
|
|
1829
|
+
```bash packageManager="yarn"
|
|
1830
|
+
yarn add @intlayer/babel --save-dev
|
|
1831
|
+
```
|
|
1832
|
+
|
|
1833
|
+
```bash packageManager="bun"
|
|
1834
|
+
bun add @intlayer/babel --dev
|
|
1835
|
+
```
|
|
1836
|
+
|
|
1837
|
+
```js fileName="babel.config.js"
|
|
1838
|
+
const {
|
|
1839
|
+
intlayerExtractBabelPlugin,
|
|
1840
|
+
getExtractPluginOptions,
|
|
1841
|
+
} = require("@intlayer/babel");
|
|
1842
|
+
|
|
1843
|
+
module.exports = {
|
|
1844
|
+
presets: ["next/babel"],
|
|
1845
|
+
plugins: [
|
|
1846
|
+
// Trích xuất nội dung từ các thành phần vào từ điển
|
|
1847
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
1848
|
+
],
|
|
1849
|
+
};
|
|
1850
|
+
```
|
|
1851
|
+
|
|
1852
|
+
```bash packageManager="npm"
|
|
1853
|
+
npm run build # Hoặc npm run dev
|
|
1854
|
+
```
|
|
1855
|
+
|
|
1856
|
+
```bash packageManager="pnpm"
|
|
1857
|
+
pnpm run build # Or pnpm run dev
|
|
1858
|
+
```
|
|
1859
|
+
|
|
1860
|
+
```bash packageManager="yarn"
|
|
1861
|
+
yarn build # Or yarn dev
|
|
1862
|
+
```
|
|
1863
|
+
|
|
1864
|
+
```bash packageManager="bun"
|
|
1865
|
+
bun run build # Or bun run dev
|
|
1866
|
+
```
|
|
1867
|
+
|
|
1868
|
+
</Tab>
|
|
1869
|
+
</Tabs>
|
|
1870
|
+
|
|
1698
1871
|
### Đi Xa Hơn
|
|
1699
1872
|
|
|
1700
1873
|
Để đi xa hơn, bạn có thể triển khai [trình chỉnh sửa trực quan](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_visual_editor.md) hoặc bên ngoài hóa nội dung của bạn bằng cách sử dụng [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_CMS.md).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2026-01-10
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-03-12
|
|
4
4
|
title: Next.js i18n - Chuyển đổi ứng dụng Next.js hiện tại thành ứng dụng đa ngôn ngữ năm 2026
|
|
5
5
|
description: Khám phá cách biến ứng dụng Next.js hiện tại của bạn thành một ứng dụng đa ngôn ngữ bằng cách sử dụng Intlayer Compiler. Theo dõi tài liệu để quốc tế hóa (i18n) và dịch ứng dụng của bạn bằng AI.
|
|
6
6
|
keywords:
|
|
@@ -501,6 +501,179 @@ Tiện ích mở rộng này cung cấp:
|
|
|
501
501
|
|
|
502
502
|
Đọc [tài liệu Tiện ích mở rộng VS Code của Intlayer](https://intlayer.org/doc/vs-code-extension) để biết hướng dẫn chi tiết về cách sử dụng tiện ích mở rộng.
|
|
503
503
|
|
|
504
|
+
### (Tùy chọn) Bước 1 : Trích xuất nội dung các thành phần của bạn
|
|
505
|
+
|
|
506
|
+
Nếu bạn có một cơ sở mã hiện có, việc chuyển đổi hàng nghìn tệp có thể tốn nhiều thời gian.
|
|
507
|
+
|
|
508
|
+
Để đơn giản hóa quy trình này, Intlayer đề xuất một [trình biên dịch](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/compiler.md) / [trình trích xuất](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/cli/extract.md) để chuyển đổi các thành phần của bạn và trích xuất nội dung.
|
|
509
|
+
|
|
510
|
+
Để thiết lập, bạn có thể thêm phần `compiler` vào tệp `intlayer.config.ts` của mình:
|
|
511
|
+
|
|
512
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
513
|
+
import { type IntlayerConfig } from "intlayer";
|
|
514
|
+
|
|
515
|
+
const config: IntlayerConfig = {
|
|
516
|
+
// ... Phần còn lại của cấu hình
|
|
517
|
+
compiler: {
|
|
518
|
+
/**
|
|
519
|
+
* Cho biết trình biên dịch có nên được bật hay không.
|
|
520
|
+
*/
|
|
521
|
+
enabled: true,
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Xác định đường dẫn các tệp đầu ra
|
|
525
|
+
*/
|
|
526
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Cho biết các thành phần có nên được lưu sau khi chuyển đổi hay không. Bằng cách đó, trình biên dịch có thể được chạy chỉ một lần để chuyển đổi ứng dụng, sau đó có thể được gỡ bỏ.
|
|
530
|
+
*/
|
|
531
|
+
saveComponents: false,
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Tiền tố khóa từ điển
|
|
535
|
+
*/
|
|
536
|
+
dictionaryKeyPrefix: "",
|
|
537
|
+
},
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
export default config;
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
544
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
545
|
+
const config = {
|
|
546
|
+
// ... Phần còn lại của cấu hình
|
|
547
|
+
compiler: {
|
|
548
|
+
/**
|
|
549
|
+
* Cho biết trình biên dịch có nên được bật hay không.
|
|
550
|
+
*/
|
|
551
|
+
enabled: true,
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Xác định đường dẫn các tệp đầu ra
|
|
555
|
+
*/
|
|
556
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Cho biết các thành phần có nên được lưu sau khi chuyển đổi hay không. Bằng cách đó, trình biên dịch có thể được chạy chỉ một lần để chuyển đổi ứng dụng, sau đó có thể được gỡ bỏ.
|
|
560
|
+
*/
|
|
561
|
+
saveComponents: false,
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Tiền tố khóa từ điển
|
|
565
|
+
*/
|
|
566
|
+
dictionaryKeyPrefix: "",
|
|
567
|
+
},
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
export default config;
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
574
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
575
|
+
const config = {
|
|
576
|
+
// ... Phần còn lại của cấu hình
|
|
577
|
+
compiler: {
|
|
578
|
+
/**
|
|
579
|
+
* Cho biết trình biên dịch có nên được bật hay không.
|
|
580
|
+
*/
|
|
581
|
+
enabled: true,
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Xác định đường dẫn các tệp đầu ra
|
|
585
|
+
*/
|
|
586
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Cho biết các thành phần có nên được lưu sau khi chuyển đổi hay không. Bằng cách đó, trình biên dịch có thể được chạy chỉ một lần để chuyển đổi ứng dụng, sau đó có thể được gỡ bỏ.
|
|
590
|
+
*/
|
|
591
|
+
saveComponents: false,
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Tiền tố khóa từ điển
|
|
595
|
+
*/
|
|
596
|
+
dictionaryKeyPrefix: "",
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
module.exports = config;
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
<Tabs>
|
|
604
|
+
<Tab value='Lệnh trích xuất'>
|
|
605
|
+
|
|
606
|
+
Chạy trình trích xuất để chuyển đổi các thành phần và trích xuất nội dung
|
|
607
|
+
|
|
608
|
+
```bash packageManager="npm"
|
|
609
|
+
npx intlayer extract
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
```bash packageManager="pnpm"
|
|
613
|
+
pnpm intlayer extract
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
```bash packageManager="yarn"
|
|
617
|
+
yarn intlayer extract
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
```bash packageManager="bun"
|
|
621
|
+
bunx intlayer extract
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
</Tab>
|
|
625
|
+
<Tab value='Trình biên dịch Babel'>
|
|
626
|
+
|
|
627
|
+
```bash packageManager="npm"
|
|
628
|
+
npm install @intlayer/babel --save-dev
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
```bash packageManager="pnpm"
|
|
632
|
+
pnpm add @intlayer/babel --save-dev
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
```bash packageManager="yarn"
|
|
636
|
+
yarn add @intlayer/babel --save-dev
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
```bash packageManager="bun"
|
|
640
|
+
bun add @intlayer/babel --dev
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
```js fileName="babel.config.js"
|
|
644
|
+
const {
|
|
645
|
+
intlayerExtractBabelPlugin,
|
|
646
|
+
getExtractPluginOptions,
|
|
647
|
+
} = require("@intlayer/babel");
|
|
648
|
+
|
|
649
|
+
module.exports = {
|
|
650
|
+
presets: ["next/babel"],
|
|
651
|
+
plugins: [
|
|
652
|
+
// Trích xuất nội dung từ các thành phần vào từ điển
|
|
653
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
654
|
+
],
|
|
655
|
+
};
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
```bash packageManager="npm"
|
|
659
|
+
npm run build # Hoặc npm run dev
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
```bash packageManager="pnpm"
|
|
663
|
+
pnpm run build # Or pnpm run dev
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
```bash packageManager="yarn"
|
|
667
|
+
yarn build # Or yarn dev
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
```bash packageManager="bun"
|
|
671
|
+
bun run build # Or bun run dev
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
</Tab>
|
|
675
|
+
</Tabs>
|
|
676
|
+
|
|
504
677
|
### Đi xa hơn
|
|
505
678
|
|
|
506
679
|
Để tiến xa hơn, bạn có thể triển khai [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_visual_editor.md) hoặc ngoại hóa nội dung của mình bằng cách sử dụng [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/vi/intlayer_CMS.md).
|