@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/zh/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: 配置
|
|
5
5
|
description: 了解如何为您的应用程序配置 Intlayer。了解各种设置和选项,以根据您的需求自定义 Intlayer。
|
|
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: 将 'baseDir' 从 'content' 配置移动到 'system' 配置
|
|
20
20
|
- version: 8.2.0
|
|
21
21
|
date: 2026-03-10
|
|
@@ -95,7 +95,7 @@ Intlayer 支持 JSON、JS、MJS 和 TS 配置文件格式:
|
|
|
95
95
|
|
|
96
96
|
## 示例配置文件
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
````typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
99
99
|
import { Locales, type IntlayerConfig } from "intlayer";
|
|
100
100
|
import { nextjsRewrite } from "intlayer/routing";
|
|
101
101
|
import { z } from "zod";
|
|
@@ -193,7 +193,7 @@ const config: IntlayerConfig = {
|
|
|
193
193
|
* Options: 'cookie', 'localStorage', 'sessionStorage', 'header', or an array of these.
|
|
194
194
|
* Default: ['cookie', 'header']
|
|
195
195
|
*/
|
|
196
|
-
storage: "cookie",
|
|
196
|
+
storage: ["cookie", "header"],
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
199
|
* Base path for the application URLs.
|
|
@@ -330,6 +330,17 @@ const config: IntlayerConfig = {
|
|
|
330
330
|
* Base URL for the AI API.
|
|
331
331
|
*/
|
|
332
332
|
baseURL: "http://localhost:3000",
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* 数据序列化
|
|
336
|
+
*
|
|
337
|
+
* 选项:
|
|
338
|
+
* - "json": 标准、可靠;使用更多 token。
|
|
339
|
+
* - "toon": 生成更少的 token,但不如 JSON 稳定。
|
|
340
|
+
*
|
|
341
|
+
* 默认值: "json"
|
|
342
|
+
*/
|
|
343
|
+
dataSerialization: "json",
|
|
333
344
|
},
|
|
334
345
|
|
|
335
346
|
/**
|
|
@@ -429,42 +440,70 @@ const config: IntlayerConfig = {
|
|
|
429
440
|
compiler: {
|
|
430
441
|
/**
|
|
431
442
|
* 指示是否应启用编译器。
|
|
443
|
+
*
|
|
444
|
+
* - false : 禁用编译器。
|
|
445
|
+
* - true : 启用编译器。
|
|
446
|
+
* - "build-only" : 在开发期间跳过编译器以加快启动速度。
|
|
447
|
+
*
|
|
448
|
+
* 默认值 : false
|
|
432
449
|
*/
|
|
433
450
|
enabled: true,
|
|
434
451
|
|
|
435
452
|
/**
|
|
436
|
-
*
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
*
|
|
453
|
+
* 定义输出文件路径。替换 `outputDir`。
|
|
454
|
+
*
|
|
455
|
+
* - 以 `./` 开头的路径相对于组件目录解析。
|
|
456
|
+
* - 以 `/` 开头的路径相对于项目根目录 (`baseDir`) 解析。
|
|
457
|
+
*
|
|
458
|
+
* - 在路径中包含 `{{locale}}` 变量将启用按语言分离开的字典生成。
|
|
459
|
+
*
|
|
460
|
+
* 示例:
|
|
461
|
+
* ```ts
|
|
462
|
+
* {
|
|
463
|
+
* // 在组件旁边创建多语言 .content.ts 文件
|
|
464
|
+
* output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
465
|
+
*
|
|
466
|
+
* // output: './{{fileName}}{{extension}}', // 使用字符串模板的等效写法
|
|
467
|
+
* }
|
|
468
|
+
* ```
|
|
469
|
+
*
|
|
470
|
+
* ```ts
|
|
471
|
+
* {
|
|
472
|
+
* // 在项目根目录下创建按语言集中的 JSON 文件
|
|
473
|
+
* output: ({ key, locale }) => `/locales/${locale}/${key}.content.json`,
|
|
474
|
+
*
|
|
475
|
+
* // output: '/locales/{{locale}}/{{key}}.content.json', // 使用字符串模板的等效写法
|
|
476
|
+
* }
|
|
477
|
+
* ```
|
|
478
|
+
*
|
|
479
|
+
* 变量列表:
|
|
480
|
+
* - `fileName`: 文件名。
|
|
481
|
+
* - `key`: 内容键。
|
|
482
|
+
* - `locale`: 内容语言。
|
|
483
|
+
* - `extension`: 文件扩展名。
|
|
484
|
+
* - `componentFileName`: 组件文件名。
|
|
485
|
+
* - `componentExtension`: 组件文件扩展名。
|
|
486
|
+
* - `format`: 字典格式。
|
|
487
|
+
* - `componentFormat`: 组件字典格式。
|
|
488
|
+
* - `componentDirPath`: 组件目录路径。
|
|
445
489
|
*/
|
|
446
|
-
|
|
490
|
+
output: ({ locale, key }) => `compiler/${locale}/${key}.json`,
|
|
447
491
|
|
|
448
492
|
/**
|
|
449
|
-
*
|
|
493
|
+
* 指示转换后是否应保存组件。
|
|
494
|
+
* 这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
450
495
|
*/
|
|
451
|
-
|
|
496
|
+
saveComponents: false,
|
|
452
497
|
|
|
453
498
|
/**
|
|
454
|
-
*
|
|
499
|
+
* 仅在生成的文件中插入内容。对于每种语言的 i18next 或 ICU MessageFormat JSON 输出非常有用。
|
|
455
500
|
*/
|
|
456
501
|
noMetadata: false,
|
|
457
502
|
|
|
458
503
|
/**
|
|
459
504
|
* 字典键前缀
|
|
460
505
|
*/
|
|
461
|
-
dictionaryKeyPrefix: "", //
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* 指示转换后是否应保存组件。
|
|
465
|
-
* 这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
466
|
-
*/
|
|
467
|
-
saveComponents: false,
|
|
506
|
+
dictionaryKeyPrefix: "", // 为所有字典键设置前缀
|
|
468
507
|
},
|
|
469
508
|
|
|
470
509
|
/**
|
|
@@ -483,7 +522,7 @@ const config: IntlayerConfig = {
|
|
|
483
522
|
};
|
|
484
523
|
|
|
485
524
|
export default config;
|
|
486
|
-
|
|
525
|
+
````
|
|
487
526
|
|
|
488
527
|
## 配置参考
|
|
489
528
|
|
|
@@ -1033,7 +1072,7 @@ Intlayer 支持多个 AI 提供商,以增强灵活性和选择。目前支持
|
|
|
1033
1072
|
|
|
1034
1073
|
- **dictionaryKeyPrefix**:
|
|
1035
1074
|
- _类型_:`string`
|
|
1036
|
-
- _默认值_:`'
|
|
1075
|
+
- _默认值_:`''`
|
|
1037
1076
|
- _描述_:提取的字典键的前缀。
|
|
1038
1077
|
- _示例_:`'my-key-'`
|
|
1039
1078
|
- _注意_:提取字典时,键是根据文件名生成的。此前缀会添加到生成的键中,以防止冲突。
|
|
@@ -1057,24 +1096,28 @@ Intlayer 支持多个 AI 提供商,以增强灵活性和选择。目前支持
|
|
|
1057
1096
|
- _描述_:定义在优化过程中应排除哪些文件的模式。
|
|
1058
1097
|
- _示例_:`['**/node_modules/**', '!**/node_modules/react/**']`
|
|
1059
1098
|
|
|
1060
|
-
- **outputDir**:
|
|
1061
|
-
- _类型_:`string`
|
|
1062
|
-
- _默认值_: `'compiler'`
|
|
1063
|
-
- _描述_:存储提取字典的目录,相对于您的项目基准路径。
|
|
1064
|
-
|
|
1065
1099
|
- **output**:
|
|
1066
1100
|
- _类型_: `FilePathPattern`
|
|
1067
|
-
- _默认值_: `
|
|
1068
|
-
- _描述_: 定义输出文件路径。替换 `outputDir
|
|
1069
|
-
- _注意_:
|
|
1070
|
-
- _
|
|
1101
|
+
- _默认值_: `undefined`
|
|
1102
|
+
- _描述_: 定义输出文件路径。替换 `outputDir`。通过字符串模板或函数支持动态变量。支持的变量:`{{fileName}}`, `{{key}}`, `{{locale}}`, `{{extension}}`, `{{componentFileName}}`, `{{componentExtension}}`, `{{format}}`, `{{componentFormat}}`, `{{componentDirPath}}`。
|
|
1103
|
+
- _注意_: 以 `./` 开头的路径相对于组件目录解析。以 `/` 开头的路径相对于项目根目录 (`baseDir`) 解析。
|
|
1104
|
+
- _注意_: 在路径中包含 `{{locale}}` 变量将启用按语言环境分离开的字典生成。
|
|
1105
|
+
- _示例_:
|
|
1106
|
+
- **在组件旁边创建多语言文件**:
|
|
1107
|
+
- 字符串: `'./{{fileName}}{{extension}}'`
|
|
1108
|
+
- 函数: `({ fileName, extension }) => \`./${fileName}${extension}\``
|
|
1109
|
+
|
|
1110
|
+
- **输出按语言环境集中的 JSON**:
|
|
1111
|
+
- 字符串: `'/locales/{{locale}}/{{key}}.content.json'`
|
|
1112
|
+
- 函数: `({ key, locale }) => \`/locales/${locale}/${key}.content.json\``
|
|
1071
1113
|
|
|
1072
1114
|
- **noMetadata**:
|
|
1073
1115
|
- _类型_: `boolean`
|
|
1074
1116
|
- _默认值_: `false`
|
|
1075
1117
|
- _描述_: 指示是否应在文件中保存元数据。如果为 true,编译器将不会保存字典的元数据(键、内容包装器)。
|
|
1076
|
-
- _注意_: 如果与 `loadJSON`
|
|
1077
|
-
- _示例_:
|
|
1118
|
+
- _注意_: 如果与 `loadJSON` 插件一起使用,则非常有用。对于每种语言的 i18next 或 ICU MessageFormat JSON 输出非常有用。
|
|
1119
|
+
- _示例_:
|
|
1120
|
+
如果为 `true`:
|
|
1078
1121
|
```json
|
|
1079
1122
|
{
|
|
1080
1123
|
"key": "value"
|
|
@@ -44,7 +44,7 @@ history:
|
|
|
44
44
|
<iframe
|
|
45
45
|
src="https://stackblitz.com/github/aymericzip/intlayer-adonisjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
46
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
|
-
title="Demo CodeSandbox -
|
|
47
|
+
title="Demo CodeSandbox - 如何使用 Intlayer 实现应用国际化"
|
|
48
48
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
49
|
loading="lazy"
|
|
50
50
|
/>
|
|
@@ -49,7 +49,7 @@ history:
|
|
|
49
49
|
<iframe
|
|
50
50
|
src="https://stackblitz.com/github/aymericzip/intlayer-express-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
51
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
-
title="Demo CodeSandbox -
|
|
52
|
+
title="Demo CodeSandbox - 如何使用 Intlayer 实现应用国际化"
|
|
53
53
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
54
|
loading="lazy"
|
|
55
55
|
/>
|
|
@@ -49,7 +49,7 @@ history:
|
|
|
49
49
|
<iframe
|
|
50
50
|
src="https://stackblitz.com/github/aymericzip/intlayer-fastify-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
51
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
-
title="Demo CodeSandbox -
|
|
52
|
+
title="Demo CodeSandbox - 如何使用 Intlayer 实现应用国际化"
|
|
53
53
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
54
|
loading="lazy"
|
|
55
55
|
/>
|
|
@@ -47,7 +47,7 @@ history:
|
|
|
47
47
|
<iframe
|
|
48
48
|
src="https://stackblitz.com/github/aymericzip/intlayer-hono-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
49
49
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
50
|
-
title="Demo CodeSandbox -
|
|
50
|
+
title="Demo CodeSandbox - 如何使用 Intlayer 实现应用国际化"
|
|
51
51
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
52
52
|
loading="lazy"
|
|
53
53
|
/>
|
|
@@ -52,7 +52,7 @@ history:
|
|
|
52
52
|
<iframe
|
|
53
53
|
src="https://stackblitz.com/github/aymericzip/intlayer-nestjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
54
54
|
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
55
|
-
title="Demo CodeSandbox -
|
|
55
|
+
title="Demo CodeSandbox - 如何使用 Intlayer 实现应用国际化"
|
|
56
56
|
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
57
57
|
loading="lazy"
|
|
58
58
|
/>
|
|
@@ -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 - 如何翻译Next.js 16 应用 2026
|
|
5
5
|
description: 了解如何让您的 Next.js 16 网站支持多语言。按照文档进行国际化 (i18n) 并对其进行翻译。
|
|
6
6
|
keywords:
|
|
@@ -1691,6 +1691,179 @@ Intlayer 使用模块扩充来利用 TypeScript 的优势,并使您的代码
|
|
|
1691
1691
|
|
|
1692
1692
|
有关如何使用该扩展的更多详细信息,请参阅 [Intlayer VS Code 扩展文档](https://intlayer.org/doc/vs-code-extension)。
|
|
1693
1693
|
|
|
1694
|
+
### (可选) 步骤 1 : 提取组件内容
|
|
1695
|
+
|
|
1696
|
+
如果您有现有的代码库,转换数千个文件可能会非常耗时。
|
|
1697
|
+
|
|
1698
|
+
为了简化此过程,Intlayer 提出了 [编译器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/compiler.md) / [提取器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/cli/extract.md) 来转换您的组件并提取内容。
|
|
1699
|
+
|
|
1700
|
+
要进行设置,您可以在 `intlayer.config.ts` 文件中添加 `compiler` 部分:
|
|
1701
|
+
|
|
1702
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
1703
|
+
import { type IntlayerConfig } from "intlayer";
|
|
1704
|
+
|
|
1705
|
+
const config: IntlayerConfig = {
|
|
1706
|
+
// ... 您的其他配置
|
|
1707
|
+
compiler: {
|
|
1708
|
+
/**
|
|
1709
|
+
* 指示是否应启用编译器。
|
|
1710
|
+
*/
|
|
1711
|
+
enabled: true,
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* 定义输出文件路径
|
|
1715
|
+
*/
|
|
1716
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* 指示在转换后是否应保存组件。这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
1720
|
+
*/
|
|
1721
|
+
saveComponents: false,
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* 字典键前缀
|
|
1725
|
+
*/
|
|
1726
|
+
dictionaryKeyPrefix: "",
|
|
1727
|
+
},
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
export default config;
|
|
1731
|
+
```
|
|
1732
|
+
|
|
1733
|
+
```javascript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
1734
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1735
|
+
const config = {
|
|
1736
|
+
// ... 您的其他配置
|
|
1737
|
+
compiler: {
|
|
1738
|
+
/**
|
|
1739
|
+
* 指示是否应启用编译器。
|
|
1740
|
+
*/
|
|
1741
|
+
enabled: true,
|
|
1742
|
+
|
|
1743
|
+
/**
|
|
1744
|
+
* 定义输出文件路径
|
|
1745
|
+
*/
|
|
1746
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1747
|
+
|
|
1748
|
+
/**
|
|
1749
|
+
* 指示在转换后是否应保存组件。这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
1750
|
+
*/
|
|
1751
|
+
saveComponents: false,
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* 字典键前缀
|
|
1755
|
+
*/
|
|
1756
|
+
dictionaryKeyPrefix: "",
|
|
1757
|
+
},
|
|
1758
|
+
};
|
|
1759
|
+
|
|
1760
|
+
export default config;
|
|
1761
|
+
```
|
|
1762
|
+
|
|
1763
|
+
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
1764
|
+
/** @type {import('intlayer').IntlayerConfig} */
|
|
1765
|
+
const config = {
|
|
1766
|
+
// ... 您的其他配置
|
|
1767
|
+
compiler: {
|
|
1768
|
+
/**
|
|
1769
|
+
* 指示是否应启用编译器。
|
|
1770
|
+
*/
|
|
1771
|
+
enabled: true,
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* 定义输出文件路径
|
|
1775
|
+
*/
|
|
1776
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* 指示在转换后是否应保存组件。这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
1780
|
+
*/
|
|
1781
|
+
saveComponents: false,
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* 字典键前缀
|
|
1785
|
+
*/
|
|
1786
|
+
dictionaryKeyPrefix: "",
|
|
1787
|
+
},
|
|
1788
|
+
};
|
|
1789
|
+
|
|
1790
|
+
module.exports = config;
|
|
1791
|
+
```
|
|
1792
|
+
|
|
1793
|
+
<Tabs>
|
|
1794
|
+
<Tab value='提取命令'>
|
|
1795
|
+
|
|
1796
|
+
运行提取器以转换组件并提取内容
|
|
1797
|
+
|
|
1798
|
+
```bash packageManager="npm"
|
|
1799
|
+
npx intlayer extract
|
|
1800
|
+
```
|
|
1801
|
+
|
|
1802
|
+
```bash packageManager="pnpm"
|
|
1803
|
+
pnpm intlayer extract
|
|
1804
|
+
```
|
|
1805
|
+
|
|
1806
|
+
```bash packageManager="yarn"
|
|
1807
|
+
yarn intlayer extract
|
|
1808
|
+
```
|
|
1809
|
+
|
|
1810
|
+
```bash packageManager="bun"
|
|
1811
|
+
bunx intlayer extract
|
|
1812
|
+
```
|
|
1813
|
+
|
|
1814
|
+
</Tab>
|
|
1815
|
+
<Tab value='Babel 编译器'>
|
|
1816
|
+
|
|
1817
|
+
```bash packageManager="npm"
|
|
1818
|
+
npm install @intlayer/babel --save-dev
|
|
1819
|
+
```
|
|
1820
|
+
|
|
1821
|
+
```bash packageManager="pnpm"
|
|
1822
|
+
pnpm add @intlayer/babel --save-dev
|
|
1823
|
+
```
|
|
1824
|
+
|
|
1825
|
+
```bash packageManager="yarn"
|
|
1826
|
+
yarn add @intlayer/babel --save-dev
|
|
1827
|
+
```
|
|
1828
|
+
|
|
1829
|
+
```bash packageManager="bun"
|
|
1830
|
+
bun add @intlayer/babel --dev
|
|
1831
|
+
```
|
|
1832
|
+
|
|
1833
|
+
```js fileName="babel.config.js"
|
|
1834
|
+
const {
|
|
1835
|
+
intlayerExtractBabelPlugin,
|
|
1836
|
+
getExtractPluginOptions,
|
|
1837
|
+
} = require("@intlayer/babel");
|
|
1838
|
+
|
|
1839
|
+
module.exports = {
|
|
1840
|
+
presets: ["next/babel"],
|
|
1841
|
+
plugins: [
|
|
1842
|
+
// 将组件内容提取到字典中
|
|
1843
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
1844
|
+
],
|
|
1845
|
+
};
|
|
1846
|
+
```
|
|
1847
|
+
|
|
1848
|
+
```bash packageManager="npm"
|
|
1849
|
+
npm run build # 或 npm run dev
|
|
1850
|
+
```
|
|
1851
|
+
|
|
1852
|
+
```bash packageManager="pnpm"
|
|
1853
|
+
pnpm run build # 或 pnpm run dev
|
|
1854
|
+
```
|
|
1855
|
+
|
|
1856
|
+
```bash packageManager="yarn"
|
|
1857
|
+
yarn build # 或 yarn dev
|
|
1858
|
+
```
|
|
1859
|
+
|
|
1860
|
+
```bash packageManager="bun"
|
|
1861
|
+
bun run build # Or bun run dev
|
|
1862
|
+
```
|
|
1863
|
+
|
|
1864
|
+
</Tab>
|
|
1865
|
+
</Tabs>
|
|
1866
|
+
|
|
1694
1867
|
### 深入了解
|
|
1695
1868
|
|
|
1696
1869
|
要深入了解,您可以实现[可视化编辑器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_visual_editor.md)或使用 [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/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 - 将现有的 Next.js 应用程序转换为多语言应用程序 2026
|
|
5
5
|
description: 了解如何使用 Intlayer 编译器将现有的 Next.js 应用程序转换为多语言。按照文档进行国际化 (i18n) 并使用 AI 进行翻译。
|
|
6
6
|
keywords:
|
|
@@ -501,6 +501,179 @@ Intlayer 使用模块扩展 (module augmentation) 来利用 TypeScript 的优势
|
|
|
501
501
|
|
|
502
502
|
阅读 [Intlayer VS Code 扩展文档](https://intlayer.org/doc/vs-code-extension) 以了解更多关于扩展使用的详细说明。
|
|
503
503
|
|
|
504
|
+
### (可选) 步骤 1 : 提取组件内容
|
|
505
|
+
|
|
506
|
+
如果您有现有的代码库,转换数千个文件可能会非常耗时。
|
|
507
|
+
|
|
508
|
+
为了简化此过程,Intlayer 提出了 [编译器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/compiler.md) / [提取器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/cli/extract.md) 来转换您的组件并提取内容。
|
|
509
|
+
|
|
510
|
+
要进行设置,您可以在 `intlayer.config.ts` 文件中添加 `compiler` 部分:
|
|
511
|
+
|
|
512
|
+
```typescript fileName="intlayer.config.ts" codeFormat="typescript"
|
|
513
|
+
import { type IntlayerConfig } from "intlayer";
|
|
514
|
+
|
|
515
|
+
const config: IntlayerConfig = {
|
|
516
|
+
// ... 您的其他配置
|
|
517
|
+
compiler: {
|
|
518
|
+
/**
|
|
519
|
+
* 指示是否应启用编译器。
|
|
520
|
+
*/
|
|
521
|
+
enabled: true,
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* 定义输出文件路径
|
|
525
|
+
*/
|
|
526
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* 指示在转换后是否应保存组件。这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
530
|
+
*/
|
|
531
|
+
saveComponents: false,
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* 字典键前缀
|
|
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
|
+
// ... 您的其他配置
|
|
547
|
+
compiler: {
|
|
548
|
+
/**
|
|
549
|
+
* 指示是否应启用编译器。
|
|
550
|
+
*/
|
|
551
|
+
enabled: true,
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* 定义输出文件路径
|
|
555
|
+
*/
|
|
556
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* 指示在转换后是否应保存组件。这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
560
|
+
*/
|
|
561
|
+
saveComponents: false,
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* 字典键前缀
|
|
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
|
+
// ... 您的其他配置
|
|
577
|
+
compiler: {
|
|
578
|
+
/**
|
|
579
|
+
* 指示是否应启用编译器。
|
|
580
|
+
*/
|
|
581
|
+
enabled: true,
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* 定义输出文件路径
|
|
585
|
+
*/
|
|
586
|
+
output: ({ fileName, extension }) => `./${fileName}${extension}`,
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* 指示在转换后是否应保存组件。这样,编译器只需运行一次即可转换应用程序,然后即可将其删除。
|
|
590
|
+
*/
|
|
591
|
+
saveComponents: false,
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* 字典键前缀
|
|
595
|
+
*/
|
|
596
|
+
dictionaryKeyPrefix: "",
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
module.exports = config;
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
<Tabs>
|
|
604
|
+
<Tab value='提取命令'>
|
|
605
|
+
|
|
606
|
+
运行提取器以转换组件并提取内容
|
|
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='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
|
+
// 将组件内容提取到字典中
|
|
653
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
654
|
+
],
|
|
655
|
+
};
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
```bash packageManager="npm"
|
|
659
|
+
npm run build # 或 npm run dev
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
```bash packageManager="pnpm"
|
|
663
|
+
pnpm run build # 或 pnpm run dev
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
```bash packageManager="yarn"
|
|
667
|
+
yarn build # 或 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
|
### 进一步深入
|
|
505
678
|
|
|
506
679
|
您可以实现 [可视化编辑器](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_visual_editor.md) 或使用 [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_CMS.md) 来实现内容的外部管理。
|