@intlayer/docs 7.3.1 → 7.3.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.
- package/README.md +0 -2
- package/blog/ar/compiler_vs_declarative_i18n.md +1 -2
- package/blog/ar/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/de/compiler_vs_declarative_i18n.md +1 -2
- package/blog/de/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/en/compiler_vs_declarative_i18n.md +1 -2
- package/blog/en/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/en/list_i18n_technologies/frameworks/svelte.md +19 -3
- package/blog/en/list_i18n_technologies/frameworks/vue.md +16 -2
- package/blog/en-GB/compiler_vs_declarative_i18n.md +1 -2
- package/blog/en-GB/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/es/compiler_vs_declarative_i18n.md +1 -2
- package/blog/es/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/fr/compiler_vs_declarative_i18n.md +1 -2
- package/blog/fr/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/hi/compiler_vs_declarative_i18n.md +1 -2
- package/blog/hi/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/id/compiler_vs_declarative_i18n.md +1 -2
- package/blog/id/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/it/compiler_vs_declarative_i18n.md +1 -2
- package/blog/it/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/ja/compiler_vs_declarative_i18n.md +1 -2
- package/blog/ja/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/ko/compiler_vs_declarative_i18n.md +1 -2
- package/blog/ko/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/pl/compiler_vs_declarative_i18n.md +1 -2
- package/blog/pl/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/pt/compiler_vs_declarative_i18n.md +1 -2
- package/blog/pt/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/ru/compiler_vs_declarative_i18n.md +1 -2
- package/blog/ru/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/tr/compiler_vs_declarative_i18n.md +1 -2
- package/blog/tr/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/vi/compiler_vs_declarative_i18n.md +1 -2
- package/blog/vi/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/blog/zh/compiler_vs_declarative_i18n.md +1 -2
- package/blog/zh/list_i18n_technologies/frameworks/flutter.md +0 -22
- package/dist/cjs/generated/docs.entry.cjs +19 -0
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +19 -0
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/types/generated/docs.entry.d.ts +1 -0
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/docs/ar/bundle_optimization.md +6 -2
- package/docs/ar/compiler.md +133 -0
- package/docs/de/bundle_optimization.md +6 -2
- package/docs/de/compiler.md +133 -0
- package/docs/en/bundle_optimization.md +6 -2
- package/docs/en/compiler.md +133 -0
- package/docs/en-GB/bundle_optimization.md +6 -2
- package/docs/en-GB/compiler.md +133 -0
- package/docs/es/bundle_optimization.md +6 -2
- package/docs/es/compiler.md +133 -0
- package/docs/fr/bundle_optimization.md +6 -2
- package/docs/fr/compiler.md +133 -0
- package/docs/hi/bundle_optimization.md +6 -2
- package/docs/hi/compiler.md +133 -0
- package/docs/id/bundle_optimization.md +6 -2
- package/docs/id/compiler.md +133 -0
- package/docs/it/bundle_optimization.md +6 -2
- package/docs/it/compiler.md +133 -0
- package/docs/ja/bundle_optimization.md +6 -2
- package/docs/ja/compiler.md +133 -0
- package/docs/ko/bundle_optimization.md +6 -2
- package/docs/ko/compiler.md +133 -0
- package/docs/pl/bundle_optimization.md +6 -2
- package/docs/pl/compiler.md +133 -0
- package/docs/pt/bundle_optimization.md +6 -2
- package/docs/pt/compiler.md +133 -0
- package/docs/ru/bundle_optimization.md +6 -2
- package/docs/ru/compiler.md +133 -0
- package/docs/tr/bundle_optimization.md +6 -2
- package/docs/tr/compiler.md +133 -0
- package/docs/vi/bundle_optimization.md +6 -2
- package/docs/vi/compiler.md +133 -0
- package/docs/zh/bundle_optimization.md +6 -2
- package/docs/zh/compiler.md +133 -0
- package/package.json +8 -7
- package/src/generated/docs.entry.ts +19 -0
|
@@ -22,6 +22,7 @@ declare const docsEntry: {
|
|
|
22
22
|
readonly './docs/en/cli/transform.md': Record<LocalesValues, Promise<string>>;
|
|
23
23
|
readonly './docs/en/cli/version.md': Record<LocalesValues, Promise<string>>;
|
|
24
24
|
readonly './docs/en/cli/watch.md': Record<LocalesValues, Promise<string>>;
|
|
25
|
+
readonly './docs/en/compiler.md': Record<LocalesValues, Promise<string>>;
|
|
25
26
|
readonly './docs/en/component_i18n.md': Record<LocalesValues, Promise<string>>;
|
|
26
27
|
readonly './docs/en/configuration.md': Record<LocalesValues, Promise<string>>;
|
|
27
28
|
readonly './docs/en/dictionary/condition.md': Record<LocalesValues, Promise<string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.entry.d.ts","names":[],"sources":["../../../src/generated/docs.entry.ts"],"sourcesContent":[],"mappings":";;;cAsDa;iCAmBK,OAAO,eAAe;EAnB3B,SAAA,
|
|
1
|
+
{"version":3,"file":"docs.entry.d.ts","names":[],"sources":["../../../src/generated/docs.entry.ts"],"sourcesContent":[],"mappings":";;;cAsDa;iCAmBK,OAAO,eAAe;EAnB3B,SAAA,uBAwuDH,EAlsDQ,MAksDR,CAlsDe,aAksDf,EAlsD8B,OAksD9B,CAAA,MAAA,CAAA,CAAA;EArtDe,SAAA,kCAAA,EAsCP,MAtCO,CAsCA,aAtCA,EAsCe,OAtCf,CAAA,MAAA,CAAA,CAAA;EAAe,SAAA,wBAAA,EAyDtB,MAzDsB,CAyDf,aAzDe,EAyDA,OAzDA,CAAA,MAAA,CAAA,CAAA;EAAtB,SAAA,gCAAA,EA4EA,MA5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jCA,CAAA,MAAA,CAAA,CAAA;EAAtB,SAAA,8BAAA,EA8kCA,MA9kCA,CA8kCO,aA9kCP,EA8kCsB,OA9kCtB,CAAA,MAAA,CAAA,CAAA;EAmBO,SAAA,gCAAA,EA8kCP,MA9kCO,CA8kCA,aA9kCA,EA8kCe,OA9kCf,CAAA,MAAA,CAAA,CAAA;EAAe,SAAA,qBAAA,EAimCtB,MAjmCsB,CAimCf,aAjmCe,EAimCA,OAjmCA,CAAA,MAAA,CAAA,CAAA;EAAtB,SAAA,0BAAA,EAonCA,MApnCA,CAonCO,aApnCP,EAonCsB,OApnCtB,CAAA,MAAA,CAAA,CAAA;EAmBO,SAAA,0BAAA,EAonCP,MApnCO,CAonCA,aApnCA,EAonCe,OApnCf,CAAA,MAAA,CAAA,CAAA;EAAe,SAAA,sBAAA,EAuoCtB,MAvoCsB,CAuoCf,aAvoCe,EAuoCA,OAvoCA,CAAA,MAAA,CAAA,CAAA;EAAtB,SAAA,sBAAA,EA0pCA,MA1pCA,CA0pCO,aA1pCP,EA0pCsB,OA1pCtB,CAAA,MAAA,CAAA,CAAA;EAmBO,SAAA,gCAAA,EA0pCP,MA1pCO,CA0pCA,aA1pCA,EA0pCe,OA1pCf,CAAA,MAAA,CAAA,CAAA;CAAe"}
|
|
@@ -153,9 +153,13 @@ const content = useIntlayer("my-key");
|
|
|
153
153
|
// Optimized code (Dynamic)
|
|
154
154
|
const content = useDictionaryAsync({
|
|
155
155
|
en: () =>
|
|
156
|
-
import(".intlayer/dynamic_dictionary/en.json").then(
|
|
156
|
+
import(".intlayer/dynamic_dictionary/my-key/en.json").then(
|
|
157
|
+
(mod) => mod.default
|
|
158
|
+
),
|
|
157
159
|
fr: () =>
|
|
158
|
-
import(".intlayer/dynamic_dictionary/fr.json").then(
|
|
160
|
+
import(".intlayer/dynamic_dictionary/my-key/fr.json").then(
|
|
161
|
+
(mod) => mod.default
|
|
162
|
+
),
|
|
159
163
|
});
|
|
160
164
|
```
|
|
161
165
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-09-09
|
|
3
|
+
updatedAt: 2025-09-09
|
|
4
|
+
title: مترجم Intlayer | استخراج المحتوى الآلي للتدويل
|
|
5
|
+
description: قم بأتمتة عملية التدويل الخاصة بك باستخدام مترجم Intlayer. استخرج المحتوى مباشرة من مكوناتك لتحقيق تدويل أسرع وأكثر كفاءة في Vite و Next.js والمزيد.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- مترجم
|
|
9
|
+
- التدويل
|
|
10
|
+
- i18n
|
|
11
|
+
- الأتمتة
|
|
12
|
+
- الاستخراج
|
|
13
|
+
- السرعة
|
|
14
|
+
- Vite
|
|
15
|
+
- Next.js
|
|
16
|
+
- React
|
|
17
|
+
- Vue
|
|
18
|
+
- Svelte
|
|
19
|
+
slugs:
|
|
20
|
+
- doc
|
|
21
|
+
- compiler
|
|
22
|
+
history:
|
|
23
|
+
- version: 7.3.1
|
|
24
|
+
date: 2025-11-27
|
|
25
|
+
changes: إصدار المترجم
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# مترجم Intlayer | استخراج المحتوى الآلي للتدويل
|
|
29
|
+
|
|
30
|
+
## ما هو مترجم Intlayer؟
|
|
31
|
+
|
|
32
|
+
يعد **مترجم Intlayer** أداة قوية مصممة لأتمتة عملية التدويل (i18n) في تطبيقاتك. يقوم بفحص شفرة المصدر الخاصة بك (JSX، TSX، Vue، Svelte) بحثًا عن إعلانات المحتوى، ويستخرجها، ويولد تلقائيًا ملفات القاموس اللازمة. يتيح لك هذا الاحتفاظ بالمحتوى بجانب مكوناتك بينما يتولى Intlayer إدارة ومزامنة قواميسك.
|
|
33
|
+
|
|
34
|
+
## لماذا تستخدم مترجم Intlayer؟
|
|
35
|
+
|
|
36
|
+
- **الأتمتة**: يلغي النسخ واللصق اليدوي للمحتوى في القواميس.
|
|
37
|
+
- **السرعة**: استخراج المحتوى بشكل محسن لضمان بقاء عملية البناء سريعة.
|
|
38
|
+
- **تجربة المطور**: احتفظ بإعلانات المحتوى في المكان الذي تُستخدم فيه، مما يحسن من سهولة الصيانة.
|
|
39
|
+
- **التحديثات الحية**: يدعم استبدال الوحدات الساخنة (HMR) لتلقي ردود فعل فورية أثناء التطوير.
|
|
40
|
+
|
|
41
|
+
راجع منشور المدونة [المترجم مقابل i18n التصريحي](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md) لمقارنة أعمق.
|
|
42
|
+
|
|
43
|
+
## لماذا لا تستخدم مترجم Intlayer؟
|
|
44
|
+
|
|
45
|
+
بينما يوفر المترجم تجربة ممتازة "تعمل مباشرة"، فإنه يقدم أيضًا بعض المقايضات التي يجب أن تكون على دراية بها:
|
|
46
|
+
|
|
47
|
+
- **الغموض الاستدلالي**: يجب على المترجم تخمين ما هو المحتوى الموجه للمستخدم مقابل منطق التطبيق (على سبيل المثال، `className="active"`، رموز الحالة، معرفات المنتجات). في قواعد التعليمات البرمجية المعقدة، يمكن أن يؤدي هذا إلى إيجابيات خاطئة أو سلاسل مفقودة تتطلب تعليقات يدوية واستثناءات.
|
|
48
|
+
- **الاستخراج الثابت فقط**: يعتمد الاستخراج القائم على المترجم على التحليل الثابت. لا يمكن اكتشاف السلاسل التي توجد فقط في وقت التشغيل (رموز أخطاء API، حقول CMS، إلخ) أو ترجمتها بواسطة المترجم وحده، لذلك لا يزال لديك حاجة إلى استراتيجية i18n وقت التشغيل التكميلية.
|
|
49
|
+
|
|
50
|
+
لمقارنة معمارية أعمق، راجع منشور المدونة [المترجم مقابل i18n التصريحي](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md).
|
|
51
|
+
|
|
52
|
+
كبديل، لأتمتة عملية i18n الخاصة بك مع الحفاظ على السيطرة الكاملة على المحتوى الخاص بك، يوفر Intlayer أيضًا أمر الاستخراج التلقائي `intlayer transform` (راجع [وثائق CLI](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/cli/transform.md))، أو أمر `Intlayer: extract content to Dictionary` من امتداد Intlayer VS Code (راجع [وثائق امتداد VS Code](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/vs_code_extension.md)).
|
|
53
|
+
|
|
54
|
+
## الاستخدام
|
|
55
|
+
|
|
56
|
+
### Vite
|
|
57
|
+
|
|
58
|
+
بالنسبة للتطبيقات المبنية على Vite (React، Vue، Svelte، إلخ)، أسهل طريقة لاستخدام المترجم هي من خلال إضافة `vite-intlayer`.
|
|
59
|
+
|
|
60
|
+
#### التثبيت
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install vite-intlayer
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### التهيئة
|
|
67
|
+
|
|
68
|
+
قم بتحديث ملف `vite.config.ts` ليشمل إضافة `intlayerCompiler`:
|
|
69
|
+
|
|
70
|
+
```ts fileName="vite.config.ts"
|
|
71
|
+
import { defineConfig } from "vite";
|
|
72
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
plugins: [
|
|
76
|
+
intlayer(),
|
|
77
|
+
intlayerCompiler(), // يضيف إضافة المترجم
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### دعم الأُطُر
|
|
83
|
+
|
|
84
|
+
تقوم إضافة Vite بالكشف التلقائي والتعامل مع أنواع الملفات المختلفة:
|
|
85
|
+
|
|
86
|
+
- **React / JSX / TSX**: يتم التعامل معها بشكل أصلي.
|
|
87
|
+
- **Vue**: يتطلب `@intlayer/vue-compiler`.
|
|
88
|
+
- **Svelte**: يتطلب `@intlayer/svelte-compiler`.
|
|
89
|
+
|
|
90
|
+
تأكد من تثبيت حزمة المترجم المناسبة لإطار العمل الخاص بك:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# لـ Vue
|
|
94
|
+
npm install @intlayer/vue-compiler
|
|
95
|
+
|
|
96
|
+
# لـ Svelte
|
|
97
|
+
npm install @intlayer/svelte-compiler
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Next.js (Babel)
|
|
101
|
+
|
|
102
|
+
بالنسبة لتطبيقات Next.js أو التطبيقات الأخرى المبنية على Webpack والتي تستخدم Babel، يمكنك تكوين المترجم باستخدام إضافة `@intlayer/babel`.
|
|
103
|
+
|
|
104
|
+
#### التثبيت
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install @intlayer/babel
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### التهيئة
|
|
111
|
+
|
|
112
|
+
قم بتحديث ملف `babel.config.js` (أو `babel.config.json`) ليشمل إضافة الاستخراج. نحن نوفر مساعدًا `getExtractPluginOptions` لتحميل تكوين Intlayer الخاص بك تلقائيًا.
|
|
113
|
+
|
|
114
|
+
```js fileName="babel.config.js"
|
|
115
|
+
const {
|
|
116
|
+
intlayerExtractBabelPlugin,
|
|
117
|
+
intlayerOptimizeBabelPlugin,
|
|
118
|
+
getExtractPluginOptions,
|
|
119
|
+
getOptimizePluginOptions,
|
|
120
|
+
} = require("@intlayer/babel");
|
|
121
|
+
|
|
122
|
+
module.exports = {
|
|
123
|
+
presets: ["next/babel"],
|
|
124
|
+
plugins: [
|
|
125
|
+
// Extract content from components into dictionaries
|
|
126
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
127
|
+
// Optimize imports by replacing useIntlayer with direct dictionary imports
|
|
128
|
+
[intlayerOptimizeBabelPlugin, getOptimizePluginOptions()],
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
يضمن هذا التكوين استخراج المحتوى المعلن في مكوناتك تلقائيًا واستخدامه لتوليد القواميس أثناء عملية البناء.
|
|
@@ -153,9 +153,13 @@ const content = useIntlayer("my-key");
|
|
|
153
153
|
// Optimierter Code (Dynamisch)
|
|
154
154
|
const content = useDictionaryAsync({
|
|
155
155
|
en: () =>
|
|
156
|
-
import(".intlayer/dynamic_dictionary/en.json").then(
|
|
156
|
+
import(".intlayer/dynamic_dictionary/my-key/en.json").then(
|
|
157
|
+
(mod) => mod.default
|
|
158
|
+
),
|
|
157
159
|
fr: () =>
|
|
158
|
-
import(".intlayer/dynamic_dictionary/fr.json").then(
|
|
160
|
+
import(".intlayer/dynamic_dictionary/my-key/fr.json").then(
|
|
161
|
+
(mod) => mod.default
|
|
162
|
+
),
|
|
159
163
|
});
|
|
160
164
|
```
|
|
161
165
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-09-09
|
|
3
|
+
updatedAt: 2025-09-09
|
|
4
|
+
title: Intlayer Compiler | Automatisierte Inhaltsextraktion für i18n
|
|
5
|
+
description: Automatisieren Sie Ihren Internationalisierungsprozess mit dem Intlayer Compiler. Extrahieren Sie Inhalte direkt aus Ihren Komponenten für schnellere und effizientere i18n in Vite, Next.js und mehr.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- Compiler
|
|
9
|
+
- Internationalisierung
|
|
10
|
+
- i18n
|
|
11
|
+
- Automatisierung
|
|
12
|
+
- Extraktion
|
|
13
|
+
- Geschwindigkeit
|
|
14
|
+
- Vite
|
|
15
|
+
- Next.js
|
|
16
|
+
- React
|
|
17
|
+
- Vue
|
|
18
|
+
- Svelte
|
|
19
|
+
slugs:
|
|
20
|
+
- doc
|
|
21
|
+
- compiler
|
|
22
|
+
history:
|
|
23
|
+
- version: 7.3.1
|
|
24
|
+
date: 2025-11-27
|
|
25
|
+
changes: Release Compiler
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Intlayer Compiler | Automatisierte Inhaltsextraktion für i18n
|
|
29
|
+
|
|
30
|
+
## Was ist der Intlayer Compiler?
|
|
31
|
+
|
|
32
|
+
Der **Intlayer Compiler** ist ein leistungsstarkes Werkzeug, das entwickelt wurde, um den Prozess der Internationalisierung (i18n) in Ihren Anwendungen zu automatisieren. Er durchsucht Ihren Quellcode (JSX, TSX, Vue, Svelte) nach Inhaltsdeklarationen, extrahiert diese und generiert automatisch die notwendigen Wörterbuchdateien. Dadurch können Sie Ihre Inhalte direkt bei den Komponenten belassen, während Intlayer die Verwaltung und Synchronisierung Ihrer Wörterbücher übernimmt.
|
|
33
|
+
|
|
34
|
+
## Warum den Intlayer Compiler verwenden?
|
|
35
|
+
|
|
36
|
+
- **Automatisierung**: Beseitigt das manuelle Kopieren und Einfügen von Inhalten in Wörterbücher.
|
|
37
|
+
- **Geschwindigkeit**: Optimierte Inhaltsextraktion, die sicherstellt, dass Ihr Build-Prozess schnell bleibt.
|
|
38
|
+
- **Entwicklererfahrung**: Behalten Sie Inhaltsdeklarationen genau dort, wo sie verwendet werden, und verbessern Sie so die Wartbarkeit.
|
|
39
|
+
- **Live-Updates**: Unterstützt Hot Module Replacement (HMR) für sofortiges Feedback während der Entwicklung.
|
|
40
|
+
|
|
41
|
+
Siehe den Blogbeitrag [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/de/compiler_vs_declarative_i18n.md) für einen tieferen Vergleich.
|
|
42
|
+
|
|
43
|
+
## Warum den Intlayer Compiler nicht verwenden?
|
|
44
|
+
|
|
45
|
+
Während der Compiler eine ausgezeichnete "funktioniert einfach so"-Erfahrung bietet, führt er auch einige Kompromisse ein, die Sie beachten sollten:
|
|
46
|
+
|
|
47
|
+
- **Heuristische Mehrdeutigkeit**: Der Compiler muss erraten, was benutzerorientierter Inhalt im Gegensatz zur Anwendungslogik ist (z. B. `className="active"`, Statuscodes, Produkt-IDs). In komplexen Codebasen kann dies zu falschen Positiven oder übersehenen Zeichenketten führen, die manuelle Anmerkungen und Ausnahmen erfordern.
|
|
48
|
+
- **Nur statische Extraktion**: Die compilerbasierte Extraktion basiert auf statischer Analyse. Zeichenketten, die nur zur Laufzeit existieren (API-Fehlercodes, CMS-Felder usw.), können vom Compiler allein nicht entdeckt oder übersetzt werden, daher benötigen Sie immer noch eine ergänzende Laufzeit-i18n-Strategie.
|
|
49
|
+
|
|
50
|
+
Für einen tieferen architektonischen Vergleich siehe den Blogbeitrag [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/de/compiler_vs_declarative_i18n.md).
|
|
51
|
+
|
|
52
|
+
Als Alternative, um Ihren i18n-Prozess zu automatisieren und gleichzeitig die volle Kontrolle über Ihren Inhalt zu behalten, bietet Intlayer auch einen Auto-Extraktionsbefehl `intlayer transform` (siehe [CLI-Dokumentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/cli/transform.md)) oder den Befehl `Intlayer: extract content to Dictionary` aus der Intlayer VS Code-Erweiterung (siehe [VS Code-Erweiterungsdokumentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/de/vs_code_extension.md)).
|
|
53
|
+
|
|
54
|
+
## Verwendung
|
|
55
|
+
|
|
56
|
+
### Vite
|
|
57
|
+
|
|
58
|
+
Für Vite-basierte Anwendungen (React, Vue, Svelte usw.) ist der einfachste Weg, den Compiler zu verwenden, das `vite-intlayer` Plugin.
|
|
59
|
+
|
|
60
|
+
#### Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install vite-intlayer
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Konfiguration
|
|
67
|
+
|
|
68
|
+
Aktualisieren Sie Ihre `vite.config.ts`, um das `intlayerCompiler` Plugin einzubinden:
|
|
69
|
+
|
|
70
|
+
```ts fileName="vite.config.ts"
|
|
71
|
+
import { defineConfig } from "vite";
|
|
72
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
plugins: [
|
|
76
|
+
intlayer(),
|
|
77
|
+
intlayerCompiler(), // Fügt das Compiler-Plugin hinzu
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Framework-Unterstützung
|
|
83
|
+
|
|
84
|
+
Das Vite-Plugin erkennt und verarbeitet automatisch verschiedene Dateitypen:
|
|
85
|
+
|
|
86
|
+
- **React / JSX / TSX**: Wird nativ unterstützt.
|
|
87
|
+
- **Vue**: Erfordert `@intlayer/vue-compiler`.
|
|
88
|
+
- **Svelte**: Erfordert `@intlayer/svelte-compiler`.
|
|
89
|
+
|
|
90
|
+
Stellen Sie sicher, dass Sie das passende Compiler-Paket für Ihr Framework installieren:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Für Vue
|
|
94
|
+
npm install @intlayer/vue-compiler
|
|
95
|
+
|
|
96
|
+
# Für Svelte
|
|
97
|
+
npm install @intlayer/svelte-compiler
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Next.js (Babel)
|
|
101
|
+
|
|
102
|
+
Für Next.js oder andere Webpack-basierte Anwendungen, die Babel verwenden, können Sie den Compiler mit dem `@intlayer/babel` Plugin konfigurieren.
|
|
103
|
+
|
|
104
|
+
#### Installation
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install @intlayer/babel
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### Konfiguration
|
|
111
|
+
|
|
112
|
+
Aktualisieren Sie Ihre `babel.config.js` (oder `babel.config.json`), um das Extraktions-Plugin einzubinden. Wir stellen einen Helfer `getExtractPluginOptions` bereit, der Ihre Intlayer-Konfiguration automatisch lädt.
|
|
113
|
+
|
|
114
|
+
```js fileName="babel.config.js"
|
|
115
|
+
const {
|
|
116
|
+
intlayerExtractBabelPlugin,
|
|
117
|
+
intlayerOptimizeBabelPlugin,
|
|
118
|
+
getExtractPluginOptions,
|
|
119
|
+
getOptimizePluginOptions,
|
|
120
|
+
} = require("@intlayer/babel");
|
|
121
|
+
|
|
122
|
+
module.exports = {
|
|
123
|
+
presets: ["next/babel"],
|
|
124
|
+
plugins: [
|
|
125
|
+
// Extract content from components into dictionaries
|
|
126
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
127
|
+
// Optimize imports by replacing useIntlayer with direct dictionary imports
|
|
128
|
+
[intlayerOptimizeBabelPlugin, getOptimizePluginOptions()],
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Diese Konfiguration stellt sicher, dass Inhalte, die in Ihren Komponenten deklariert sind, automatisch extrahiert und während Ihres Build-Prozesses zur Generierung von Wörterbüchern verwendet werden.
|
|
@@ -153,9 +153,13 @@ const content = useIntlayer("my-key");
|
|
|
153
153
|
// Optimized code (Dynamic)
|
|
154
154
|
const content = useDictionaryAsync({
|
|
155
155
|
en: () =>
|
|
156
|
-
import(".intlayer/dynamic_dictionary/en.json").then(
|
|
156
|
+
import(".intlayer/dynamic_dictionary/my-key/en.json").then(
|
|
157
|
+
(mod) => mod.default
|
|
158
|
+
),
|
|
157
159
|
fr: () =>
|
|
158
|
-
import(".intlayer/dynamic_dictionary/fr.json").then(
|
|
160
|
+
import(".intlayer/dynamic_dictionary/my-key/fr.json").then(
|
|
161
|
+
(mod) => mod.default
|
|
162
|
+
),
|
|
159
163
|
});
|
|
160
164
|
```
|
|
161
165
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-09-09
|
|
3
|
+
updatedAt: 2025-09-09
|
|
4
|
+
title: Intlayer Compiler | Automated Content Extraction for i18n
|
|
5
|
+
description: Automate your internationalization process with the Intlayer Compiler. Extract content directly from your components for faster, more efficient i18n in Vite, Next.js, and more.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- Compiler
|
|
9
|
+
- Internationalization
|
|
10
|
+
- i18n
|
|
11
|
+
- Automation
|
|
12
|
+
- Extraction
|
|
13
|
+
- Speed
|
|
14
|
+
- Vite
|
|
15
|
+
- Next.js
|
|
16
|
+
- React
|
|
17
|
+
- Vue
|
|
18
|
+
- Svelte
|
|
19
|
+
slugs:
|
|
20
|
+
- doc
|
|
21
|
+
- compiler
|
|
22
|
+
history:
|
|
23
|
+
- version: 7.3.1
|
|
24
|
+
date: 2025-11-27
|
|
25
|
+
changes: Release Compiler
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Intlayer Compiler | Automated Content Extraction for i18n
|
|
29
|
+
|
|
30
|
+
## What is the Intlayer Compiler?
|
|
31
|
+
|
|
32
|
+
The **Intlayer Compiler** is a powerful tool designed to automate the process of internationalization (i18n) in your applications. It scans your source code (JSX, TSX, Vue, Svelte) for content declarations, extracts them, and automatically generates the necessary dictionary files. This allows you to keep your content co-located with your components while Intlayer handles the management and synchronization of your dictionaries.
|
|
33
|
+
|
|
34
|
+
## Why Use the Intlayer Compiler?
|
|
35
|
+
|
|
36
|
+
- **Automation**: Eliminates manual copy-pasting of content into dictionaries.
|
|
37
|
+
- **Speed**: Optimized content extraction ensuring your build process remains fast.
|
|
38
|
+
- **Developer Experience**: Keep content declarations right where they are used, improving maintainability.
|
|
39
|
+
- **Live Updates**: Supports Hot Module Replacement (HMR) for instant feedback during development.
|
|
40
|
+
|
|
41
|
+
See the [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md) blog post for a deeper comparison.
|
|
42
|
+
|
|
43
|
+
## Why not use the Intlayer Compiler?
|
|
44
|
+
|
|
45
|
+
While the compiler offers an excellent "just works" experience, it also introduces some trade-offs you should be aware of:
|
|
46
|
+
|
|
47
|
+
- **Heuristic ambiguity**: The compiler must guess what is user-facing content vs. application logic (e.g., `className="active"`, status codes, product IDs). In complex codebases, this can lead to false positives or missed strings that require manual annotations and exceptions.
|
|
48
|
+
- **Static-only extraction**: Compiler-based extraction relies on static analysis. Strings that only exist at runtime (API error codes, CMS fields, etc.) cannot be discovered or translated by the compiler alone, so you still need a complementary runtime i18n strategy.
|
|
49
|
+
|
|
50
|
+
For a deeper architectural comparison, see the blog post [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md).
|
|
51
|
+
|
|
52
|
+
As an alternative, to automate your i18n process while keeping full control of your content, Intlayer also provides an auto-extraction command `intlayer transform` (see [CLI documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/cli/transform.md)), or the `Intlayer: extract content to Dictionary` command from the Intlayer VS Code extension (see [VS Code extension documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/vs_code_extension.md)).
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
### Vite
|
|
57
|
+
|
|
58
|
+
For Vite-based applications (React, Vue, Svelte, etc.), the easiest way to use the compiler is through the `vite-intlayer` plugin.
|
|
59
|
+
|
|
60
|
+
#### Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install vite-intlayer
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Configuration
|
|
67
|
+
|
|
68
|
+
Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
|
|
69
|
+
|
|
70
|
+
```ts fileName="vite.config.ts"
|
|
71
|
+
import { defineConfig } from "vite";
|
|
72
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
plugins: [
|
|
76
|
+
intlayer(),
|
|
77
|
+
intlayerCompiler(), // Adds the compiler plugin
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Framework Support
|
|
83
|
+
|
|
84
|
+
The Vite plugin automatically detects and handles different file types:
|
|
85
|
+
|
|
86
|
+
- **React / JSX / TSX**: Handled natively.
|
|
87
|
+
- **Vue**: Requires `@intlayer/vue-compiler`.
|
|
88
|
+
- **Svelte**: Requires `@intlayer/svelte-compiler`.
|
|
89
|
+
|
|
90
|
+
Make sure to install the appropriate compiler package for your framework:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# For Vue
|
|
94
|
+
npm install @intlayer/vue-compiler
|
|
95
|
+
|
|
96
|
+
# For Svelte
|
|
97
|
+
npm install @intlayer/svelte-compiler
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Next.js (Babel)
|
|
101
|
+
|
|
102
|
+
For Next.js or other Webpack-based applications using Babel, you can configure the compiler using the `@intlayer/babel` plugin.
|
|
103
|
+
|
|
104
|
+
#### Installation
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install @intlayer/babel
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### Configuration
|
|
111
|
+
|
|
112
|
+
Update your `babel.config.js` (or `babel.config.json`) to include the extraction plugin. We provide a helper `getExtractPluginOptions` to load your Intlayer configuration automatically.
|
|
113
|
+
|
|
114
|
+
```js fileName="babel.config.js"
|
|
115
|
+
const {
|
|
116
|
+
intlayerExtractBabelPlugin,
|
|
117
|
+
intlayerOptimizeBabelPlugin,
|
|
118
|
+
getExtractPluginOptions,
|
|
119
|
+
getOptimizePluginOptions,
|
|
120
|
+
} = require("@intlayer/babel");
|
|
121
|
+
|
|
122
|
+
module.exports = {
|
|
123
|
+
presets: ["next/babel"],
|
|
124
|
+
plugins: [
|
|
125
|
+
// Extract content from components into dictionaries
|
|
126
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
127
|
+
// Optimize imports by replacing useIntlayer with direct dictionary imports
|
|
128
|
+
[intlayerOptimizeBabelPlugin, getOptimizePluginOptions()],
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
This configuration ensures that content declared in your components is automatically extracted and used to generate dictionaries during your build process.
|
|
@@ -153,9 +153,13 @@ const content = useIntlayer("my-key");
|
|
|
153
153
|
// Optimised code (Dynamic)
|
|
154
154
|
const content = useDictionaryAsync({
|
|
155
155
|
en: () =>
|
|
156
|
-
import(".intlayer/dynamic_dictionary/en.json").then(
|
|
156
|
+
import(".intlayer/dynamic_dictionary/my-key/en.json").then(
|
|
157
|
+
(mod) => mod.default
|
|
158
|
+
),
|
|
157
159
|
fr: () =>
|
|
158
|
-
import(".intlayer/dynamic_dictionary/fr.json").then(
|
|
160
|
+
import(".intlayer/dynamic_dictionary/my-key/fr.json").then(
|
|
161
|
+
(mod) => mod.default
|
|
162
|
+
),
|
|
159
163
|
});
|
|
160
164
|
```
|
|
161
165
|
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2025-09-09
|
|
3
|
+
updatedAt: 2025-09-09
|
|
4
|
+
title: Intlayer Compiler | Automated Content Extraction for i18n
|
|
5
|
+
description: Automate your internationalisation process with the Intlayer Compiler. Extract content directly from your components for faster, more efficient i18n in Vite, Next.js, and more.
|
|
6
|
+
keywords:
|
|
7
|
+
- Intlayer
|
|
8
|
+
- Compiler
|
|
9
|
+
- Internationalisation
|
|
10
|
+
- i18n
|
|
11
|
+
- Automation
|
|
12
|
+
- Extraction
|
|
13
|
+
- Speed
|
|
14
|
+
- Vite
|
|
15
|
+
- Next.js
|
|
16
|
+
- React
|
|
17
|
+
- Vue
|
|
18
|
+
- Svelte
|
|
19
|
+
slugs:
|
|
20
|
+
- doc
|
|
21
|
+
- compiler
|
|
22
|
+
history:
|
|
23
|
+
- version: 7.3.1
|
|
24
|
+
date: 2025-11-27
|
|
25
|
+
changes: Release Compiler
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Intlayer Compiler | Automated Content Extraction for i18n
|
|
29
|
+
|
|
30
|
+
## What is the Intlayer Compiler?
|
|
31
|
+
|
|
32
|
+
The **Intlayer Compiler** is a powerful tool designed to automate the process of internationalisation (i18n) in your applications. It scans your source code (JSX, TSX, Vue, Svelte) for content declarations, extracts them, and automatically generates the necessary dictionary files. This allows you to keep your content co-located with your components while Intlayer handles the management and synchronisation of your dictionaries.
|
|
33
|
+
|
|
34
|
+
## Why Use the Intlayer Compiler?
|
|
35
|
+
|
|
36
|
+
- **Automation**: Eliminates manual copy-pasting of content into dictionaries.
|
|
37
|
+
- **Speed**: Optimised content extraction ensuring your build process remains fast.
|
|
38
|
+
- **Developer Experience**: Keep content declarations right where they are used, improving maintainability.
|
|
39
|
+
- **Live Updates**: Supports Hot Module Replacement (HMR) for instant feedback during development.
|
|
40
|
+
|
|
41
|
+
See the [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md) blog post for a deeper comparison.
|
|
42
|
+
|
|
43
|
+
## Why not use the Intlayer Compiler?
|
|
44
|
+
|
|
45
|
+
Whilst the compiler offers an excellent "just works" experience, it also introduces some trade-offs you should be aware of:
|
|
46
|
+
|
|
47
|
+
- **Heuristic ambiguity**: The compiler must guess what is user-facing content vs. application logic (e.g., `className="active"`, status codes, product IDs). In complex codebases, this can lead to false positives or missed strings that require manual annotations and exceptions.
|
|
48
|
+
- **Static-only extraction**: Compiler-based extraction relies on static analysis. Strings that only exist at runtime (API error codes, CMS fields, etc.) cannot be discovered or translated by the compiler alone, so you still need a complementary runtime i18n strategy.
|
|
49
|
+
|
|
50
|
+
For a deeper architectural comparison, see the blog post [Compiler vs. Declarative i18n](https://github.com/aymericzip/intlayer/blob/main/docs/blog/en/compiler_vs_declarative_i18n.md).
|
|
51
|
+
|
|
52
|
+
As an alternative, to automate your i18n process whilst keeping full control of your content, Intlayer also provides an auto-extraction command `intlayer transform` (see [CLI documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/cli/transform.md)), or the `Intlayer: extract content to Dictionary` command from the Intlayer VS Code extension (see [VS Code extension documentation](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en-GB/vs_code_extension.md)).
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
### Vite
|
|
57
|
+
|
|
58
|
+
For Vite-based applications (React, Vue, Svelte, etc.), the easiest way to use the compiler is through the `vite-intlayer` plugin.
|
|
59
|
+
|
|
60
|
+
#### Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install vite-intlayer
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Configuration
|
|
67
|
+
|
|
68
|
+
Update your `vite.config.ts` to include the `intlayerCompiler` plugin:
|
|
69
|
+
|
|
70
|
+
```ts fileName="vite.config.ts"
|
|
71
|
+
import { defineConfig } from "vite";
|
|
72
|
+
import { intlayer, intlayerCompiler } from "vite-intlayer";
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
plugins: [
|
|
76
|
+
intlayer(),
|
|
77
|
+
intlayerCompiler(), // Adds the compiler plugin
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Framework Support
|
|
83
|
+
|
|
84
|
+
The Vite plugin automatically detects and handles different file types:
|
|
85
|
+
|
|
86
|
+
- **React / JSX / TSX**: Handled natively.
|
|
87
|
+
- **Vue**: Requires `@intlayer/vue-compiler`.
|
|
88
|
+
- **Svelte**: Requires `@intlayer/svelte-compiler`.
|
|
89
|
+
|
|
90
|
+
Make sure to install the appropriate compiler package for your framework:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# For Vue
|
|
94
|
+
npm install @intlayer/vue-compiler
|
|
95
|
+
|
|
96
|
+
# For Svelte
|
|
97
|
+
npm install @intlayer/svelte-compiler
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Next.js (Babel)
|
|
101
|
+
|
|
102
|
+
For Next.js or other Webpack-based applications using Babel, you can configure the compiler using the `@intlayer/babel` plugin.
|
|
103
|
+
|
|
104
|
+
#### Installation
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install @intlayer/babel
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### Configuration
|
|
111
|
+
|
|
112
|
+
Update your `babel.config.js` (or `babel.config.json`) to include the extraction plugin. We provide a helper `getExtractPluginOptions` to load your Intlayer configuration automatically.
|
|
113
|
+
|
|
114
|
+
```js fileName="babel.config.js"
|
|
115
|
+
const {
|
|
116
|
+
intlayerExtractBabelPlugin,
|
|
117
|
+
intlayerOptimizeBabelPlugin,
|
|
118
|
+
getExtractPluginOptions,
|
|
119
|
+
getOptimizePluginOptions,
|
|
120
|
+
} = require("@intlayer/babel");
|
|
121
|
+
|
|
122
|
+
module.exports = {
|
|
123
|
+
presets: ["next/babel"],
|
|
124
|
+
plugins: [
|
|
125
|
+
// Extract content from components into dictionaries
|
|
126
|
+
[intlayerExtractBabelPlugin, getExtractPluginOptions()],
|
|
127
|
+
// Optimize imports by replacing useIntlayer with direct dictionary imports
|
|
128
|
+
[intlayerOptimizeBabelPlugin, getOptimizePluginOptions()],
|
|
129
|
+
],
|
|
130
|
+
};
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
This configuration ensures that content declared in your components is automatically extracted and used to generate dictionaries during your build process.
|
|
@@ -153,9 +153,13 @@ const content = useIntlayer("my-key");
|
|
|
153
153
|
// Código optimizado (Dinámico)
|
|
154
154
|
const content = useDictionaryAsync({
|
|
155
155
|
en: () =>
|
|
156
|
-
import(".intlayer/dynamic_dictionary/en.json").then(
|
|
156
|
+
import(".intlayer/dynamic_dictionary/my-key/en.json").then(
|
|
157
|
+
(mod) => mod.default
|
|
158
|
+
),
|
|
157
159
|
fr: () =>
|
|
158
|
-
import(".intlayer/dynamic_dictionary/fr.json").then(
|
|
160
|
+
import(".intlayer/dynamic_dictionary/my-key/fr.json").then(
|
|
161
|
+
(mod) => mod.default
|
|
162
|
+
),
|
|
159
163
|
});
|
|
160
164
|
```
|
|
161
165
|
|