@intlayer/docs 7.2.0 → 7.2.3
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/intlayer_cli.md +37 -1
- package/docs/ar/intlayer_with_svelte_kit.md +11 -2
- package/docs/de/intlayer_cli.md +37 -1
- package/docs/de/intlayer_with_svelte_kit.md +11 -2
- package/docs/en/intlayer_cli.md +41 -1
- package/docs/en/intlayer_with_nextjs_16.md +10 -2
- package/docs/en/intlayer_with_svelte_kit.md +13 -2
- package/docs/en-GB/intlayer_cli.md +37 -1
- package/docs/en-GB/intlayer_with_svelte_kit.md +11 -2
- package/docs/es/intlayer_cli.md +37 -1
- package/docs/es/intlayer_with_svelte_kit.md +11 -2
- package/docs/fr/intlayer_cli.md +37 -1
- package/docs/fr/intlayer_with_svelte_kit.md +11 -2
- package/docs/hi/intlayer_cli.md +37 -1
- package/docs/hi/intlayer_with_svelte_kit.md +11 -2
- package/docs/id/intlayer_cli.md +37 -1
- package/docs/id/intlayer_with_svelte_kit.md +11 -2
- package/docs/it/intlayer_cli.md +37 -1
- package/docs/it/intlayer_with_svelte_kit.md +11 -2
- package/docs/ja/intlayer_cli.md +37 -1
- package/docs/ja/intlayer_with_svelte_kit.md +11 -2
- package/docs/ko/intlayer_cli.md +37 -1
- package/docs/ko/intlayer_with_svelte_kit.md +11 -2
- package/docs/pl/intlayer_cli.md +37 -1
- package/docs/pl/intlayer_with_svelte_kit.md +11 -2
- package/docs/pt/intlayer_cli.md +37 -1
- package/docs/pt/intlayer_with_svelte_kit.md +11 -2
- package/docs/ru/intlayer_cli.md +37 -1
- package/docs/ru/intlayer_with_svelte_kit.md +11 -2
- package/docs/tr/intlayer_cli.md +37 -1
- package/docs/tr/intlayer_with_svelte_kit.md +11 -2
- package/docs/vi/intlayer_cli.md +37 -1
- package/docs/vi/intlayer_with_svelte_kit.md +11 -2
- package/docs/zh/intlayer_cli.md +37 -1
- package/docs/zh/intlayer_with_svelte_kit.md +11 -2
- package/package.json +9 -9
|
@@ -44,6 +44,14 @@ Intlayer ile şunları yapabilirsiniz:
|
|
|
44
44
|
|
|
45
45
|
Başlamak için yeni bir SvelteKit projesi oluşturun. İşte oluşturacağımız son yapı:
|
|
46
46
|
|
|
47
|
+
<iframe
|
|
48
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-sveltekit-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
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 - Cách quốc tế hóa ứng dụng của bạn bằng Intlayer"
|
|
51
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
52
|
+
loading="lazy"
|
|
53
|
+
/>
|
|
54
|
+
|
|
47
55
|
```bash
|
|
48
56
|
.
|
|
49
57
|
├── intlayer.config.ts
|
|
@@ -547,8 +555,9 @@ export const load: Load = ({ params }) => {
|
|
|
547
555
|
let { children, data }: { children: Snippet, data: LayoutData } = $props();
|
|
548
556
|
|
|
549
557
|
// Yönlendirmeden alınan locale ile Intlayer'ı başlat
|
|
550
|
-
|
|
551
|
-
|
|
558
|
+
$effect(() => {
|
|
559
|
+
setupIntlayer(data.locale);
|
|
560
|
+
});
|
|
552
561
|
// Layout içerik sözlüğünü kullan
|
|
553
562
|
const layoutContent = useIntlayer('layout');
|
|
554
563
|
</script>
|
package/docs/vi/intlayer_cli.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-11
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-11-22
|
|
4
4
|
title: CLI
|
|
5
5
|
description: Khám phá cách sử dụng Intlayer CLI để quản lý trang web đa ngôn ngữ của bạn. Làm theo các bước trong tài liệu trực tuyến này để thiết lập dự án của bạn trong vài phút.
|
|
6
6
|
keywords:
|
|
@@ -17,6 +17,9 @@ slugs:
|
|
|
17
17
|
- concept
|
|
18
18
|
- cli
|
|
19
19
|
history:
|
|
20
|
+
- version: 7.2.3
|
|
21
|
+
date: 2025-11-22
|
|
22
|
+
changes: Thêm lệnh transform
|
|
20
23
|
- version: 6.1.4
|
|
21
24
|
date: 2025-01-27
|
|
22
25
|
changes: Thêm bí danh cho các đối số và lệnh CLI
|
|
@@ -426,6 +429,39 @@ npx intlayer fill --file src/home/*.content.ts --source-locale en --output-local
|
|
|
426
429
|
|
|
427
430
|
Lệnh này sẽ dịch nội dung từ tiếng Anh sang tiếng Pháp và tiếng Tây Ban Nha cho tất cả các file khai báo nội dung trong thư mục `src/home/` sử dụng mô hình GPT-3.5 Turbo.
|
|
428
431
|
|
|
432
|
+
### Chuyển đổi thành phần
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
npx intlayer transform
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
Lệnh này phân tích các file mã của bạn để giúp di chuyển các thành phần hiện có sang sử dụng Intlayer. Nó hỗ trợ lựa chọn file tương tác hoặc nhắm mục tiêu file cụ thể.
|
|
439
|
+
|
|
440
|
+
##### Bí danh:
|
|
441
|
+
|
|
442
|
+
- `npx intlayer trans`
|
|
443
|
+
|
|
444
|
+
##### Đối số:
|
|
445
|
+
|
|
446
|
+
**Tùy chọn lựa chọn file:**
|
|
447
|
+
|
|
448
|
+
- **`-f, --file [files...]`**: Danh sách các file cụ thể cần chuyển đổi. Nếu không được cung cấp, CLI sẽ quét các file khớp (`**/*.{tsx,jsx,vue,svelte,ts,js}`) và nhắc bạn chọn file nào cần chuyển đổi.
|
|
449
|
+
|
|
450
|
+
> Ví dụ: `npx intlayer transform -f src/components/MyComponent.tsx`
|
|
451
|
+
|
|
452
|
+
**Tùy chọn đầu ra:**
|
|
453
|
+
|
|
454
|
+
- **`-o, --output-content-declarations [outputContentDeclarations]`**: Thư mục để lưu các file khai báo nội dung đã tạo.
|
|
455
|
+
|
|
456
|
+
> Ví dụ: `npx intlayer transform -o src/content`
|
|
457
|
+
|
|
458
|
+
**Tùy chọn cấu hình:**
|
|
459
|
+
|
|
460
|
+
- **`--base-dir`**: Chỉ định thư mục cơ sở cho dự án.
|
|
461
|
+
- **`--env`**: Chỉ định môi trường.
|
|
462
|
+
- **`--env-file`**: Cung cấp file môi trường tùy chỉnh.
|
|
463
|
+
- **`--verbose`**: Bật ghi log chi tiết.
|
|
464
|
+
|
|
429
465
|
### Kiểm tra bản dịch còn thiếu
|
|
430
466
|
|
|
431
467
|
```bash
|
|
@@ -42,6 +42,14 @@ Với Intlayer, bạn có thể:
|
|
|
42
42
|
|
|
43
43
|
## Hướng dẫn từng bước để thiết lập Intlayer trong ứng dụng SvelteKit
|
|
44
44
|
|
|
45
|
+
<iframe
|
|
46
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-sveltekit-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
47
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
48
|
+
title="Demo CodeSandbox - Cách quốc tế hóa ứng dụng của bạn bằng Intlayer"
|
|
49
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
50
|
+
loading="lazy"
|
|
51
|
+
/>
|
|
52
|
+
|
|
45
53
|
Để bắt đầu, hãy tạo một dự án SvelteKit mới. Dưới đây là cấu trúc cuối cùng mà chúng ta sẽ tạo:
|
|
46
54
|
|
|
47
55
|
```bash
|
|
@@ -547,8 +555,9 @@ export const load: Load = ({ params }) => {
|
|
|
547
555
|
let { children, data }: { children: Snippet, data: LayoutData } = $props();
|
|
548
556
|
|
|
549
557
|
// Khởi tạo Intlayer với locale lấy từ route
|
|
550
|
-
|
|
551
|
-
|
|
558
|
+
$effect(() => {
|
|
559
|
+
setupIntlayer(data.locale);
|
|
560
|
+
});
|
|
552
561
|
// Sử dụng từ điển nội dung layout
|
|
553
562
|
const layoutContent = useIntlayer('layout');
|
|
554
563
|
</script>
|
package/docs/zh/intlayer_cli.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-11
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-11-22
|
|
4
4
|
title: CLI
|
|
5
5
|
description: 了解如何使用 Intlayer CLI 来管理您的多语言网站。按照本在线文档中的步骤,几分钟内即可设置您的项目。
|
|
6
6
|
keywords:
|
|
@@ -17,6 +17,9 @@ slugs:
|
|
|
17
17
|
- concept
|
|
18
18
|
- cli
|
|
19
19
|
history:
|
|
20
|
+
- version: 7.2.3
|
|
21
|
+
date: 2025-11-22
|
|
22
|
+
changes: 添加 transform 命令
|
|
20
23
|
- version: 5.5.11
|
|
21
24
|
date: 2025-07-11
|
|
22
25
|
changes: 更新 CLI 命令参数文档
|
|
@@ -310,6 +313,39 @@ npx intlayer fill --file src/home/*.content.ts --source-locale en --output-local
|
|
|
310
313
|
|
|
311
314
|
此命令将使用 GPT-3.5 Turbo 模型,将 `src/home/` 目录下所有内容声明文件的内容从英语翻译成法语和西班牙语。
|
|
312
315
|
|
|
316
|
+
### 转换组件
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
npx intlayer transform
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
此命令分析您的代码文件,以帮助将现有组件迁移到使用 Intlayer。它支持交互式文件选择或指定特定文件。
|
|
323
|
+
|
|
324
|
+
##### 别名:
|
|
325
|
+
|
|
326
|
+
- `npx intlayer trans`
|
|
327
|
+
|
|
328
|
+
##### 参数:
|
|
329
|
+
|
|
330
|
+
**文件选择选项:**
|
|
331
|
+
|
|
332
|
+
- **`-f, --file [files...]`**: 要转换的特定文件列表。如果未提供,CLI 将扫描匹配的文件(`**/*.{tsx,jsx,vue,svelte,ts,js}`)并提示您选择要转换的文件。
|
|
333
|
+
|
|
334
|
+
> 示例: `npx intlayer transform -f src/components/MyComponent.tsx`
|
|
335
|
+
|
|
336
|
+
**输出选项:**
|
|
337
|
+
|
|
338
|
+
- **`-o, --output-content-declarations [outputContentDeclarations]`**: 保存生成的内容声明文件的目录。
|
|
339
|
+
|
|
340
|
+
> 示例: `npx intlayer transform -o src/content`
|
|
341
|
+
|
|
342
|
+
**配置选项:**
|
|
343
|
+
|
|
344
|
+
- **`--base-dir`**: 指定项目的基础目录。
|
|
345
|
+
- **`--env`**: 指定环境。
|
|
346
|
+
- **`--env-file`**: 提供自定义环境文件。
|
|
347
|
+
- **`--verbose`**: 启用详细日志记录。
|
|
348
|
+
|
|
313
349
|
### 管理配置
|
|
314
350
|
|
|
315
351
|
#### 获取配置
|
|
@@ -44,6 +44,14 @@ history:
|
|
|
44
44
|
|
|
45
45
|
首先,创建一个新的 SvelteKit 项目。以下是我们将要构建的最终结构:
|
|
46
46
|
|
|
47
|
+
<iframe
|
|
48
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-sveltekit-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
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 - Cách quốc tế hóa ứng dụng của bạn bằng Intlayer"
|
|
51
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
52
|
+
loading="lazy"
|
|
53
|
+
/>
|
|
54
|
+
|
|
47
55
|
```bash
|
|
48
56
|
.
|
|
49
57
|
├── intlayer.config.ts
|
|
@@ -547,8 +555,9 @@ export const load: Load = ({ params }) => {
|
|
|
547
555
|
let { children, data }: { children: Snippet, data: LayoutData } = $props();
|
|
548
556
|
|
|
549
557
|
// 使用路由中的 locale 初始化 Intlayer
|
|
550
|
-
|
|
551
|
-
|
|
558
|
+
$effect(() => {
|
|
559
|
+
setupIntlayer(data.locale);
|
|
560
|
+
});
|
|
552
561
|
// 使用布局内容字典
|
|
553
562
|
const layoutContent = useIntlayer('layout');
|
|
554
563
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/docs",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer documentation",
|
|
6
6
|
"keywords": [
|
|
@@ -72,23 +72,23 @@
|
|
|
72
72
|
"watch": "webpack --config ./webpack.config.ts --watch"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@intlayer/config": "7.2.
|
|
76
|
-
"@intlayer/core": "7.2.
|
|
77
|
-
"@intlayer/types": "7.2.
|
|
75
|
+
"@intlayer/config": "7.2.3",
|
|
76
|
+
"@intlayer/core": "7.2.3",
|
|
77
|
+
"@intlayer/types": "7.2.3"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@intlayer/api": "7.2.
|
|
81
|
-
"@intlayer/cli": "7.2.
|
|
80
|
+
"@intlayer/api": "7.2.3",
|
|
81
|
+
"@intlayer/cli": "7.2.3",
|
|
82
82
|
"@types/node": "24.10.1",
|
|
83
83
|
"@utils/ts-config": "1.0.4",
|
|
84
84
|
"@utils/ts-config-types": "1.0.4",
|
|
85
85
|
"@utils/tsdown-config": "1.0.4",
|
|
86
86
|
"fast-glob": "3.3.3",
|
|
87
|
-
"rimraf": "6.1.
|
|
88
|
-
"tsdown": "0.16.
|
|
87
|
+
"rimraf": "6.1.2",
|
|
88
|
+
"tsdown": "0.16.6",
|
|
89
89
|
"tsx": "^4.20.6",
|
|
90
90
|
"typescript": "5.9.3",
|
|
91
|
-
"vitest": "4.0.
|
|
91
|
+
"vitest": "4.0.12"
|
|
92
92
|
},
|
|
93
93
|
"engines": {
|
|
94
94
|
"node": ">=14.18"
|