@intlayer/docs 7.5.9 → 7.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +9 -2
  2. package/dist/cjs/generated/docs.entry.cjs +57 -0
  3. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  4. package/dist/esm/generated/docs.entry.mjs +57 -0
  5. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  6. package/dist/types/generated/docs.entry.d.ts +3 -0
  7. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  8. package/docs/ar/cli/ci.md +137 -0
  9. package/docs/ar/cli/index.md +7 -1
  10. package/docs/ar/cli/list.md +39 -2
  11. package/docs/ar/cli/list_projects.md +131 -0
  12. package/docs/ar/cli/push.md +1 -1
  13. package/docs/ar/configuration.md +3 -3
  14. package/docs/ar/interest_of_intlayer.md +1 -1
  15. package/docs/ar/intlayer_CMS.md +25 -5
  16. package/docs/ar/intlayer_with_express.md +1 -0
  17. package/docs/ar/intlayer_with_fastify.md +516 -0
  18. package/docs/ar/readme.md +1 -1
  19. package/docs/de/cli/ci.md +137 -0
  20. package/docs/de/cli/index.md +7 -1
  21. package/docs/de/cli/list.md +39 -2
  22. package/docs/de/cli/list_projects.md +130 -0
  23. package/docs/de/cli/push.md +1 -1
  24. package/docs/de/configuration.md +3 -3
  25. package/docs/de/interest_of_intlayer.md +1 -1
  26. package/docs/de/intlayer_CMS.md +25 -5
  27. package/docs/de/intlayer_with_express.md +1 -0
  28. package/docs/de/intlayer_with_fastify.md +449 -0
  29. package/docs/de/readme.md +1 -1
  30. package/docs/en/cli/ci.md +137 -0
  31. package/docs/en/cli/index.md +14 -1
  32. package/docs/en/cli/list.md +39 -2
  33. package/docs/en/cli/list_projects.md +128 -0
  34. package/docs/en/cli/push.md +1 -1
  35. package/docs/en/configuration.md +3 -3
  36. package/docs/en/interest_of_intlayer.md +2 -2
  37. package/docs/en/intlayer_CMS.md +25 -5
  38. package/docs/en/intlayer_with_express.md +1 -0
  39. package/docs/en/intlayer_with_fastify.md +439 -0
  40. package/docs/en/readme.md +3 -1
  41. package/docs/en-GB/cli/ci.md +137 -0
  42. package/docs/en-GB/cli/index.md +7 -1
  43. package/docs/en-GB/cli/list.md +39 -2
  44. package/docs/en-GB/cli/list_projects.md +130 -0
  45. package/docs/en-GB/cli/push.md +1 -1
  46. package/docs/en-GB/configuration.md +3 -3
  47. package/docs/en-GB/interest_of_intlayer.md +1 -1
  48. package/docs/en-GB/intlayer_CMS.md +25 -5
  49. package/docs/en-GB/intlayer_with_express.md +1 -0
  50. package/docs/en-GB/intlayer_with_fastify.md +445 -0
  51. package/docs/en-GB/readme.md +3 -1
  52. package/docs/es/cli/ci.md +137 -0
  53. package/docs/es/cli/index.md +7 -1
  54. package/docs/es/cli/list.md +39 -2
  55. package/docs/es/cli/list_projects.md +130 -0
  56. package/docs/es/cli/push.md +1 -1
  57. package/docs/es/configuration.md +3 -3
  58. package/docs/es/interest_of_intlayer.md +1 -1
  59. package/docs/es/intlayer_CMS.md +25 -5
  60. package/docs/es/intlayer_with_express.md +1 -0
  61. package/docs/es/intlayer_with_fastify.md +480 -0
  62. package/docs/es/readme.md +1 -1
  63. package/docs/fr/cli/ci.md +137 -0
  64. package/docs/fr/cli/index.md +7 -1
  65. package/docs/fr/cli/list.md +39 -2
  66. package/docs/fr/cli/list_projects.md +131 -0
  67. package/docs/fr/cli/push.md +1 -1
  68. package/docs/fr/configuration.md +3 -3
  69. package/docs/fr/interest_of_intlayer.md +1 -1
  70. package/docs/fr/intlayer_CMS.md +25 -5
  71. package/docs/fr/intlayer_with_express.md +1 -0
  72. package/docs/fr/intlayer_with_fastify.md +439 -0
  73. package/docs/fr/readme.md +1 -1
  74. package/docs/hi/cli/ci.md +137 -0
  75. package/docs/hi/cli/index.md +7 -1
  76. package/docs/hi/cli/list.md +38 -1
  77. package/docs/hi/cli/list_projects.md +130 -0
  78. package/docs/hi/cli/push.md +1 -1
  79. package/docs/hi/configuration.md +3 -3
  80. package/docs/hi/interest_of_intlayer.md +1 -1
  81. package/docs/hi/intlayer_CMS.md +25 -5
  82. package/docs/hi/intlayer_with_express.md +1 -0
  83. package/docs/hi/intlayer_with_fastify.md +540 -0
  84. package/docs/hi/readme.md +1 -1
  85. package/docs/id/cli/ci.md +137 -0
  86. package/docs/id/cli/index.md +7 -1
  87. package/docs/id/cli/list.md +38 -1
  88. package/docs/id/cli/list_projects.md +128 -0
  89. package/docs/id/cli/push.md +1 -1
  90. package/docs/id/configuration.md +3 -3
  91. package/docs/id/interest_of_intlayer.md +1 -1
  92. package/docs/id/intlayer_CMS.md +25 -5
  93. package/docs/id/intlayer_with_express.md +1 -0
  94. package/docs/id/intlayer_with_fastify.md +470 -0
  95. package/docs/id/readme.md +1 -1
  96. package/docs/it/cli/ci.md +137 -0
  97. package/docs/it/cli/index.md +7 -1
  98. package/docs/it/cli/list.md +39 -2
  99. package/docs/it/cli/list_projects.md +130 -0
  100. package/docs/it/cli/push.md +1 -1
  101. package/docs/it/configuration.md +3 -3
  102. package/docs/it/interest_of_intlayer.md +1 -1
  103. package/docs/it/intlayer_CMS.md +25 -5
  104. package/docs/it/intlayer_with_express.md +1 -0
  105. package/docs/it/intlayer_with_fastify.md +445 -0
  106. package/docs/it/readme.md +1 -1
  107. package/docs/ja/cli/ci.md +137 -0
  108. package/docs/ja/cli/index.md +7 -1
  109. package/docs/ja/cli/list.md +38 -1
  110. package/docs/ja/cli/list_projects.md +136 -0
  111. package/docs/ja/cli/push.md +1 -1
  112. package/docs/ja/configuration.md +3 -3
  113. package/docs/ja/interest_of_intlayer.md +1 -1
  114. package/docs/ja/intlayer_CMS.md +25 -5
  115. package/docs/ja/intlayer_with_express.md +1 -0
  116. package/docs/ja/intlayer_with_fastify.md +516 -0
  117. package/docs/ja/readme.md +1 -1
  118. package/docs/ko/cli/ci.md +137 -0
  119. package/docs/ko/cli/index.md +7 -1
  120. package/docs/ko/cli/list.md +38 -1
  121. package/docs/ko/cli/list_projects.md +128 -0
  122. package/docs/ko/cli/push.md +1 -1
  123. package/docs/ko/configuration.md +3 -3
  124. package/docs/ko/interest_of_intlayer.md +1 -1
  125. package/docs/ko/intlayer_CMS.md +25 -5
  126. package/docs/ko/intlayer_with_express.md +1 -0
  127. package/docs/ko/intlayer_with_fastify.md +463 -0
  128. package/docs/ko/readme.md +1 -1
  129. package/docs/pl/cli/ci.md +137 -0
  130. package/docs/pl/cli/index.md +7 -1
  131. package/docs/pl/cli/list.md +39 -2
  132. package/docs/pl/cli/list_projects.md +130 -0
  133. package/docs/pl/cli/push.md +1 -1
  134. package/docs/pl/configuration.md +3 -3
  135. package/docs/pl/interest_of_intlayer.md +1 -1
  136. package/docs/pl/intlayer_CMS.md +25 -5
  137. package/docs/pl/intlayer_with_express.md +1 -0
  138. package/docs/pl/intlayer_with_fastify.md +457 -0
  139. package/docs/pl/readme.md +1 -1
  140. package/docs/pt/cli/ci.md +137 -0
  141. package/docs/pt/cli/index.md +7 -1
  142. package/docs/pt/cli/list.md +39 -2
  143. package/docs/pt/cli/list_projects.md +134 -0
  144. package/docs/pt/cli/push.md +1 -1
  145. package/docs/pt/configuration.md +3 -3
  146. package/docs/pt/interest_of_intlayer.md +1 -1
  147. package/docs/pt/intlayer_CMS.md +25 -5
  148. package/docs/pt/intlayer_with_express.md +1 -0
  149. package/docs/pt/intlayer_with_fastify.md +502 -0
  150. package/docs/pt/readme.md +1 -1
  151. package/docs/ru/cli/ci.md +137 -0
  152. package/docs/ru/cli/index.md +7 -1
  153. package/docs/ru/cli/list.md +39 -2
  154. package/docs/ru/cli/list_projects.md +130 -0
  155. package/docs/ru/cli/push.md +1 -1
  156. package/docs/ru/configuration.md +3 -3
  157. package/docs/ru/interest_of_intlayer.md +1 -1
  158. package/docs/ru/intlayer_CMS.md +25 -5
  159. package/docs/ru/intlayer_with_express.md +1 -0
  160. package/docs/ru/intlayer_with_fastify.md +468 -0
  161. package/docs/ru/readme.md +1 -1
  162. package/docs/tr/cli/ci.md +137 -0
  163. package/docs/tr/cli/index.md +7 -1
  164. package/docs/tr/cli/list.md +39 -2
  165. package/docs/tr/cli/list_projects.md +134 -0
  166. package/docs/tr/cli/push.md +1 -1
  167. package/docs/tr/configuration.md +3 -3
  168. package/docs/tr/interest_of_intlayer.md +1 -1
  169. package/docs/tr/intlayer_CMS.md +25 -5
  170. package/docs/tr/intlayer_with_express.md +1 -0
  171. package/docs/tr/intlayer_with_fastify.md +471 -0
  172. package/docs/tr/readme.md +1 -1
  173. package/docs/vi/cli/ci.md +137 -0
  174. package/docs/vi/cli/index.md +7 -1
  175. package/docs/vi/cli/list.md +38 -1
  176. package/docs/vi/cli/list_projects.md +130 -0
  177. package/docs/vi/cli/push.md +1 -1
  178. package/docs/vi/configuration.md +3 -3
  179. package/docs/vi/interest_of_intlayer.md +1 -1
  180. package/docs/vi/intlayer_CMS.md +25 -5
  181. package/docs/vi/intlayer_with_express.md +1 -0
  182. package/docs/vi/intlayer_with_fastify.md +490 -0
  183. package/docs/vi/readme.md +1 -1
  184. package/docs/zh/cli/ci.md +137 -0
  185. package/docs/zh/cli/index.md +7 -1
  186. package/docs/zh/cli/list.md +38 -1
  187. package/docs/zh/cli/list_projects.md +130 -0
  188. package/docs/zh/cli/push.md +1 -1
  189. package/docs/zh/configuration.md +3 -3
  190. package/docs/zh/interest_of_intlayer.md +1 -1
  191. package/docs/zh/intlayer_CMS.md +25 -5
  192. package/docs/zh/intlayer_with_express.md +1 -0
  193. package/docs/zh/intlayer_with_fastify.md +451 -0
  194. package/docs/zh/readme.md +1 -1
  195. package/package.json +6 -6
  196. package/src/generated/docs.entry.ts +57 -0
@@ -0,0 +1,516 @@
1
+ ---
2
+ createdAt: 2025-12-30
3
+ updatedAt: 2025-12-30
4
+ title: كيفية ترجمة الـ backend الخاص بـ Fastify – دليل التدويل (i18n) 2026
5
+ description: اكتشف كيفية جعل خادم Fastify الخاص بك متعدد اللغات. اتبع الوثائق لتدويل (i18n) وترجمته.
6
+ keywords:
7
+ - التدويل
8
+ - الوثائق
9
+ - Intlayer
10
+ - Fastify
11
+ - JavaScript
12
+ - الخادم
13
+ slugs:
14
+ - doc
15
+ - environment
16
+ - fastify
17
+ applicationTemplate: https://github.com/aymericzip/intlayer-fastify-template
18
+ history:
19
+ - version: 7.6.0
20
+ date: 2025-12-31
21
+ changes: إضافة أمر init
22
+ - version: 7.6.0
23
+ date: 2025-12-31
24
+ changes: تهيئة السجل
25
+ ---
26
+
27
+ # ترجمة موقع الويب الخاص بخادم Fastify باستخدام Intlayer | التدويل (i18n)
28
+
29
+ `fastify-intlayer` هو ملحق (plugin) قوي للتدويل (i18n) لتطبيقات Fastify، مصمم لجعل خدمات الـ backend الخاصة بك متاحة عالميًا من خلال تقديم استجابات محلية حسب تفضيلات العميل.
30
+
31
+ ### حالات استخدام عملية
32
+
33
+ - **عرض أخطاء الـ backend بلغة المستخدم**: عند حدوث خطأ، عرض الرسائل بلغة المستخدم الأم يُحسّن الفهم ويقلل الإحباط. هذا مفيد بشكل خاص للرسائل الديناميكية للأخطاء التي قد تُعرض في مكونات الواجهة الأمامية مثل toasts أو modals.
34
+
35
+ `fastify-intlayer` هو مكون إضافي قوي للتدويل (i18n) لتطبيقات Fastify، مصمم لجعل خدمات backend الخاصة بك متاحة عالميًا من خلال تقديم استجابات مَحَلّية بناءً على تفضيلات العميل.
36
+
37
+ ### حالات استخدام عملية
38
+
39
+ - **عرض أخطاء الخادم بلغة المستخدم**: عندما يحدث خطأ، فإن عرض الرسائل بلغة المستخدم الأم يحسّن الفهم ويقلل الإحباط. هذا مفيد بشكل خاص للرسائل الديناميكية للأخطاء التي قد تُعرض في مكونات الواجهة الأمامية مثل toasts أو modals.
40
+ - **استرجاع محتوى متعدد اللغات**: بالنسبة للتطبيقات التي تجلب المحتوى من قاعدة بيانات، يضمن التدويل أنه يمكنك تقديم هذا المحتوى بعدة لغات. هذا أمر حاسم لمنصات مثل مواقع e-commerce أو أنظمة إدارة المحتوى التي تحتاج إلى عرض أوصاف المنتجات والمقالات ومحتويات أخرى باللغة التي يفضلها المستخدم.
41
+ - **إرسال رسائل بريد إلكتروني متعددة اللغات**: سواء كانت transactional emails أو حملات تسويقية أو notifications، فإن إرسال الرسائل البريدية بلغة المستلم يمكن أن يزيد بشكل كبير من التفاعل والفعالية.
42
+ - **الإشعارات المتعددة اللغات (Multilingual Push Notifications)**: بالنسبة لتطبيقات الجوال، إرسال إشعارات الدفع بلغة مفضلة لدى المستخدم يمكن أن يعزز التفاعل والاحتفاظ بالمستخدمين. تضيف هذه اللمسة الشخصية شعورًا بأن الإشعارات ذات صلة وقابلة للتنفيذ.
43
+ - **وسائل اتصال أخرى**: أي شكل من أشكال الاتصال من الـ backend، مثل رسائل SMS أو تنبيهات النظام أو تحديثات واجهة المستخدم، يستفيد من تقديمه بلغة المستخدم، مما يضمن الوضوح ويعزز تجربة المستخدم العامة.
44
+
45
+ من خلال تدويل الـ backend، لا يحترم تطبيقك الفروق الثقافية فحسب، بل يتماشى أيضًا بشكل أفضل مع احتياجات السوق العالمية، مما يجعله خطوة أساسية لتوسيع نطاق خدماتك عالميًا.
46
+
47
+ ## البدء
48
+
49
+ ### التثبيت
50
+
51
+ لبدء استخدام `fastify-intlayer`، قم بتثبيت الحزمة باستخدام npm:
52
+
53
+ ```bash packageManager="npm"
54
+ npm install intlayer fastify-intlayer
55
+ npx intlayer init
56
+
57
+ ```
58
+
59
+ ```bash packageManager="pnpm"
60
+ pnpm add intlayer fastify-intlayer
61
+ pnpm intlayer init
62
+
63
+ ```
64
+
65
+ ```bash packageManager="yarn"
66
+ yarn add intlayer fastify-intlayer
67
+ yarn intlayer init
68
+
69
+ ```
70
+
71
+ ```bash packageManager="bun"
72
+ bun add intlayer fastify-intlayer
73
+ bunx intlayer init
74
+
75
+ ```
76
+
77
+ ### الإعداد
78
+
79
+ قم بتكوين إعدادات التدويل بإنشاء ملف `intlayer.config.ts` في جذر مشروعك:
80
+
81
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
82
+ import { Locales, type IntlayerConfig } from "intlayer";
83
+
84
+ const config: IntlayerConfig = {
85
+ internationalization: {
86
+ locales: [
87
+ Locales.ENGLISH,
88
+ Locales.FRENCH,
89
+ Locales.SPANISH_MEXICO,
90
+ Locales.SPANISH_SPAIN,
91
+ ],
92
+ defaultLocale: Locales.ENGLISH,
93
+ },
94
+ };
95
+
96
+ export default config;
97
+ ```
98
+
99
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
100
+ import { Locales } from "intlayer";
101
+
102
+ /** @type {import('intlayer').IntlayerConfig} */
103
+ const config = {
104
+ internationalization: {
105
+ locales: [
106
+ Locales.ENGLISH,
107
+ Locales.FRENCH,
108
+ Locales.SPANISH_MEXICO,
109
+ Locales.SPANISH_SPAIN,
110
+ ],
111
+ defaultLocale: Locales.ENGLISH,
112
+ },
113
+ };
114
+
115
+ export default config;
116
+ ```
117
+
118
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
119
+ const { Locales } = require("intlayer");
120
+
121
+ /** @type {import('intlayer').IntlayerConfig} */
122
+ const config = {
123
+ internationalization: {
124
+ locales: [
125
+ Locales.ENGLISH,
126
+ Locales.FRENCH,
127
+ Locales.SPANISH_MEXICO,
128
+ Locales.SPANISH_SPAIN,
129
+ ],
130
+ defaultLocale: Locales.ENGLISH,
131
+ },
132
+ };
133
+
134
+ module.exports = config;
135
+ ```
136
+
137
+ ### إعلان المحتوى
138
+
139
+ أنشئ وادِر تعريفات المحتوى الخاصة بك لتخزين الترجمات:
140
+
141
+ ```typescript fileName="src/index.content.ts" contentDeclarationFormat="typescript"
142
+ import { t, type Dictionary } from "intlayer";
143
+
144
+ const indexContent = {
145
+ key: "index",
146
+ content: {
147
+ exampleOfContent: t({
148
+ ar: "مثال على المحتوى المعاد باللغة الإنجليزية",
149
+ en: "Example of returned content in English",
150
+ fr: "Exemple de contenu renvoyé en français",
151
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
152
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
153
+ }),
154
+ },
155
+ } satisfies Dictionary;
156
+
157
+ export default indexContent;
158
+ ```
159
+
160
+ ```javascript fileName="src/index.content.mjs" contentDeclarationFormat="esm"
161
+ import { t } from "intlayer";
162
+
163
+ /** @type {import('intlayer').Dictionary} */
164
+ const indexContent = {
165
+ key: "index",
166
+ content: {
167
+ exampleOfContent: t({
168
+ ar: "مثال على المحتوى المعاد باللغة الإنجليزية",
169
+ en: "Example of returned content in English",
170
+ fr: "Exemple de contenu renvoyé en français",
171
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
172
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
173
+ }),
174
+ },
175
+ };
176
+
177
+ export default indexContent;
178
+ ```
179
+
180
+ ```javascript fileName="src/index.content.cjs" contentDeclarationFormat="commonjs"
181
+ const { t } = require("intlayer");
182
+
183
+ /** @type {import('intlayer').Dictionary} */
184
+ const indexContent = {
185
+ key: "index",
186
+ content: {
187
+ exampleOfContent: t({
188
+ ar: "مثال على المحتوى المعاد باللغة الإنجليزية",
189
+ en: "Example of returned content in English",
190
+ fr: "Exemple de contenu renvoyé en français",
191
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
192
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
193
+ }),
194
+ },
195
+ };
196
+
197
+ module.exports = indexContent;
198
+ javascript fileName="src/index.content.cjs" contentDeclarationFormat="commonjs"
199
+ const { t } = require("intlayer");
200
+
201
+ /** @type {import('intlayer').Dictionary} */
202
+ const indexContent = {
203
+ key: "index",
204
+ content: {
205
+ exampleOfContent: t({
206
+ ar: "مثال على المحتوى المعاد باللغة الإنجليزية",
207
+ en: "Example of returned content in English",
208
+ fr: "Exemple de contenu renvoyé en français",
209
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
210
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
211
+ }),
212
+ },
213
+ };
214
+
215
+ module.exports = indexContent;
216
+ ```
217
+
218
+ ```json fileName="src/index.content.json" contentDeclarationFormat="json"
219
+ {
220
+ "$schema": "https://intlayer.org/schema.json",
221
+ "key": "index",
222
+ "content": {
223
+ "exampleOfContent": {
224
+ "nodeType": "translation",
225
+ "translation": {
226
+ "ar": "مثال على المحتوى المعاد باللغة الإنجليزية",
227
+ "en": "Example of returned content in English",
228
+ "fr": "Exemple de contenu renvoyé en français",
229
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
230
+ "es-MX": "Ejemplo de contenido devuelto en español (México)"
231
+ }
232
+ }
233
+ }
234
+ }
235
+ ```
236
+
237
+ > يمكن تعريف إعلانات المحتوى (content declarations) في أي مكان داخل تطبيقك طالما أنها مضمنة في دليل `contentDir` (افتراضياً `./src`). ويجب أن تتطابق مع امتداد ملف إعلان المحتوى (افتراضياً `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
238
+
239
+ > لمزيد من التفاصيل، راجع [توثيق إعلان المحتوى](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/dictionary/content_file.md).
240
+
241
+ ### إعداد تطبيق Fastify
242
+
243
+ أعد إعداد تطبيق Fastify لاستخدام `fastify-intlayer`:
244
+
245
+ ```typescript fileName="src/index.ts" codeFormat="typescript"
246
+ import Fastify from "fastify";
247
+ import { intlayer, t, getDictionary, getIntlayer } from "fastify-intlayer";
248
+ import dictionaryExample from "./index.content";
249
+
250
+ const fastify = Fastify({ logger: true });
251
+
252
+ // تحميل إضافة التدويل
253
+ await fastify.register(intlayer);
254
+
255
+ // المسارات
256
+ fastify.get("/t_example", async (_req, reply) => {
257
+ return t({
258
+ ar: "مثال على المحتوى المُعاد باللغة الإنجليزية",
259
+ en: "Example of returned content in English",
260
+ fr: "Exemple de contenu renvoyé en français",
261
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
262
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
263
+ });
264
+ });
265
+
266
+ fastify.get("/getIntlayer_example", async (_req, reply) => {
267
+ return getIntlayer("index").exampleOfContent;
268
+ });
269
+
270
+ fastify.get("/getDictionary_example", async (_req, reply) => {
271
+ return getDictionary(dictionaryExample).exampleOfContent;
272
+ });
273
+
274
+ // بدء الخادم
275
+ const start = async () => {
276
+ try {
277
+ await fastify.listen({ port: 3000 });
278
+ } catch (err) {
279
+ fastify.log.error(err);
280
+ process.exit(1);
281
+ }
282
+ };
283
+
284
+ start();
285
+ ```
286
+
287
+ ```javascript fileName="src/index.mjs" codeFormat="esm"
288
+ import Fastify from "fastify";
289
+ import { intlayer, t, getDictionary, getIntlayer } from "fastify-intlayer";
290
+ import dictionaryExample from "./index.content";
291
+
292
+ const fastify = Fastify({ logger: true });
293
+
294
+ // تحميل إضافة التدويل
295
+ await fastify.register(intlayer);
296
+
297
+ // المسارات
298
+ fastify.get("/t_example", async (_req, reply) => {
299
+ return t({
300
+ ar: "مثال على المحتوى المعاد باللغة العربية",
301
+ en: "Example of returned content in English",
302
+ fr: "Exemple de contenu renvoyé en français",
303
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
304
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
305
+ });
306
+ });
307
+
308
+ fastify.get("/getIntlayer_example", async (_req, reply) => {
309
+ return getIntlayer("index").exampleOfContent;
310
+ });
311
+
312
+ javascript fileName="src/index.mjs" codeFormat="esm"
313
+ fastify.get("/getDictionary_example", async (_req, reply) => {
314
+ return getDictionary(dictionaryExample).exampleOfContent;
315
+ });
316
+
317
+ // بدء الخادم
318
+ const start = async () => {
319
+ try {
320
+ await fastify.listen({ port: 3000 });
321
+ } catch (err) {
322
+ fastify.log.error(err);
323
+ process.exit(1);
324
+ }
325
+ };
326
+
327
+ start();
328
+ ```
329
+
330
+ ```javascript fileName="src/index.cjs" codeFormat="commonjs"
331
+ const Fastify = require("fastify");
332
+ const { intlayer, t, getDictionary, getIntlayer } = require("fastify-intlayer");
333
+ const dictionaryExample = require("./index.content");
334
+
335
+ const fastify = Fastify({ logger: true });
336
+
337
+ // غلاف بدء الخادم لـ async/await
338
+ const start = async () => {
339
+ try {
340
+ // تحميل مكون التدويل
341
+ await fastify.register(intlayer);
342
+
343
+ // المسارات
344
+ fastify.get("/t_example", async (_req, reply) => {
345
+ return t({
346
+ ar: "مثال على المحتوى المعاد باللغة العربية",
347
+ en: "Example of returned content in English",
348
+ fr: "Exemple de contenu renvoyé en français",
349
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
350
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
351
+ });
352
+ });
353
+
354
+ fastify.get("/getIntlayer_example", async (_req, reply) => {
355
+ return getIntlayer("index").exampleOfContent;
356
+ });
357
+
358
+ fastify.get("/getDictionary_example", async (_req, reply) => {
359
+ return getDictionary(dictionaryExample).exampleOfContent;
360
+ });
361
+
362
+ await fastify.listen({ port: 3000 });
363
+ } catch (err) {
364
+ fastify.log.error(err);
365
+ process.exit(1);
366
+ }
367
+ };
368
+
369
+ start();
370
+ ```
371
+
372
+ ```javascript fileName="src/index.cjs" codeFormat="commonjs"
373
+ const Fastify = require("fastify");
374
+ const { intlayer, t, getDictionary, getIntlayer } = require("fastify-intlayer");
375
+ const dictionaryExample = require("./index.content");
376
+
377
+ const fastify = Fastify({ logger: true });
378
+
379
+ // Start server wrapper for async/await
380
+ const start = async () => {
381
+ try {
382
+ // Load internationalization plugin
383
+ await fastify.register(intlayer);
384
+
385
+ // Routes
386
+ fastify.get("/t_example", async (_req, reply) => {
387
+ return t({
388
+ ar: "مثال على المحتوى المعاد باللغة العربية",
389
+ en: "Example of returned content in English",
390
+ fr: "Exemple de contenu renvoyé en français",
391
+ "es-ES": "Ejemplo de contenido devuelto en español (España)",
392
+ "es-MX": "Ejemplo de contenido devuelto en español (México)",
393
+ });
394
+ });
395
+
396
+ fastify.get("/getIntlayer_example", async (_req, reply) => {
397
+ return getIntlayer("index").exampleOfContent;
398
+ });
399
+
400
+ fastify.get("/getDictionary_example", async (_req, reply) => {
401
+ return getDictionary(dictionaryExample).exampleOfContent;
402
+ });
403
+
404
+ await fastify.listen({ port: 3000 });
405
+ } catch (err) {
406
+ fastify.log.error(err);
407
+ process.exit(1);
408
+ }
409
+ };
410
+
411
+ start();
412
+ ```
413
+
414
+ ### التوافق
415
+
416
+ `fastify-intlayer` متوافق تمامًا مع:
417
+
418
+ - [`react-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/react-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/react-intlayer/index.md)>) لتطبيقات React
419
+ - [`next-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/next-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/next-intlayer/index.md)>) لتطبيقات Next.js
420
+
421
+ - [`react-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/react-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/react-intlayer/index.md)>) لتطبيقات React
422
+ - [`next-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/next-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/next-intlayer/index.md)>) لتطبيقات Next.js
423
+ - [`vite-intlayer`](<https://www.google.com/search?q=%5Bhttps://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/vite-intlayer/index.md%5D(https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/packages/vite-intlayer/index.md)>) لتطبيقات Vite
424
+
425
+ كما يعمل بسلاسة مع أي حل للتدويل عبر بيئات متعددة، بما في ذلك المتصفحات وطلبات API. يمكنك تخصيص الـ middleware لاكتشاف اللغة عبر الرؤوس أو الكوكيز:
426
+
427
+ ```typescript fileName="intlayer.config.ts" codeFormat="typescript"
428
+ import { Locales, type IntlayerConfig } from "intlayer";
429
+
430
+ const config: IntlayerConfig = {
431
+ // ... خيارات التكوين الأخرى
432
+ middleware: {
433
+ headerName: "my-locale-header",
434
+ cookieName: "my-locale-cookie",
435
+ },
436
+ };
437
+
438
+ export default config;
439
+ ```
440
+
441
+ ```javascript fileName="intlayer.config.mjs" codeFormat="esm"
442
+ import { Locales } from "intlayer";
443
+
444
+ /** @type {import('intlayer').IntlayerConfig} */
445
+ const config = {
446
+ // ... خيارات تكوين أخرى
447
+ middleware: {
448
+ headerName: "my-locale-header",
449
+ cookieName: "my-locale-cookie",
450
+ },
451
+ };
452
+
453
+ export default config;
454
+ ```
455
+
456
+ ```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
457
+ const { Locales } = require("intlayer");
458
+
459
+ /** @type {import('intlayer').IntlayerConfig} */
460
+ const config = {
461
+ // ... خيارات تكوين أخرى
462
+ middleware: {
463
+ headerName: "my-locale-header",
464
+ cookieName: "my-locale-cookie",
465
+ },
466
+ };
467
+
468
+ module.exports = config;
469
+ ```
470
+
471
+ بشكل افتراضي، سيقوم `fastify-intlayer` بتفسير رأس الطلب `Accept-Language` لتحديد اللغة المفضلة لدى العميل.
472
+
473
+ > لمزيد من المعلومات حول التكوين والمواضيع المتقدمة، قم بزيارة [التوثيق](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ar/configuration.md).
474
+
475
+ ### تكوين TypeScript
476
+
477
+ `fastify-intlayer` يستفيد من القدرات القوية لـ TypeScript لتحسين عملية التدويل. يضمن نظام الكتابة الثابتة في TypeScript أن كل مفتاح ترجمة مغطى، مما يقلل من خطر فقدان الترجمات ويحسن قابلية الصيانة.
478
+
479
+ تأكد من تضمين الأنواع المولدة تلقائياً (بشكل افتراضي في ./types/intlayer.d.ts) في ملف tsconfig.json الخاص بك.
480
+
481
+ ```json5 fileName="tsconfig.json"
482
+ {
483
+ // ... تكوينات TypeScript الحالية الخاصة بك
484
+ "include": [
485
+ // ... تكوينات TypeScript الحالية الخاصة بك
486
+ ".intlayer/**/*.ts", // تضمين الأنواع المولدة تلقائياً
487
+ ],
488
+ }
489
+ ```
490
+
491
+ ### امتداد VS Code
492
+
493
+ لتحسين تجربة التطوير مع Intlayer، يمكنك تثبيت الامتداد الرسمي **Intlayer VS Code Extension**.
494
+
495
+ [التثبيت من سوق إضافات VS Code](https://marketplace.visualstudio.com/items?itemName=intlayer.intlayer-vs-code-extension)
496
+
497
+ يقدّم هذا الامتداد:
498
+
499
+ - **الإكمال التلقائي** لمفاتيح الترجمة.
500
+ - **كشف الأخطاء في الوقت الحقيقي** للترجمات المفقودة.
501
+ - **معاينات مُضمّنة** للمحتوى المترجم.
502
+ - **إجراءات سريعة** لإنشاء وتحديث الترجمات بسهولة.
503
+
504
+ لمزيد من التفاصيل حول كيفية استخدام الامتداد، راجع وثائق امتداد Intlayer لـ VS Code: [Intlayer VS Code Extension documentation](https://intlayer.org/doc/vs-code-extension).
505
+
506
+ ### تكوين Git
507
+
508
+ يوصى بتجاهل الملفات التي يولّدها Intlayer. يتيح ذلك تجنّب عمل commit لها في مستودع Git الخاص بك.
509
+
510
+ لتحقيق ذلك، يمكنك إضافة التعليمات التالية إلى ملف `.gitignore` الخاص بك:
511
+
512
+ ```plaintext fileName=".gitignore"
513
+ # تجاهل الملفات التي تم إنشاؤها بواسطة Intlayer
514
+ .intlayer
515
+
516
+ ```
package/docs/ar/readme.md CHANGED
@@ -50,7 +50,7 @@ Intlayer هو **حل تدويل حديث** لتطبيقات الويب واله
50
50
  | الميزة | الوصف |
51
51
  | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
52
52
  | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/frameworks.png?raw=true" alt="ميزة" width="700"> | **دعم عبر الأُطُر المتعددة**<br><br>يتوافق Intlayer مع جميع الأُطُر والمكتبات الرئيسية، بما في ذلك Next.js وReact وVite وVue.js وNuxt وPreact وExpress والمزيد. |
53
- | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.png?raw=true" alt="ميزة" width="700"> | **إدارة المحتوى مدعومة بجافا سكريبت**<br><br>استفد من مرونة جافا سكريبت لتعريف وإدارة محتواك بكفاءة. <br><br> - [إعلان المحتوى](https://intlayer.org/doc/concept/content) |
53
+ | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/javascript_content_management.jpg?raw=true" alt="ميزة" width="700"> | **إدارة المحتوى مدعومة بجافا سكريبت**<br><br>استفد من مرونة جافا سكريبت لتعريف وإدارة محتواك بكفاءة. <br><br> - [إعلان المحتوى](https://intlayer.org/doc/concept/content) |
54
54
  | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/per_locale_content_declaration_file.png?raw=true" alt="ميزة" width="700"> | **ملف إعلان المحتوى لكل لغة**<br><br>سرّع عملية تطويرك من خلال إعلان محتواك مرة واحدة، قبل التوليد التلقائي.<br><br> - [ملف إعلان المحتوى لكل لغة](https://intlayer.org/doc/concept/per-locale-file) |
55
55
  | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/autocompletion.png?raw=true" alt="ميزة" width="700"> | **بيئة آمنة من حيث النوع**<br><br>استفد من TypeScript لضمان أن تعريفات المحتوى والكود الخاص بك خالية من الأخطاء، مع الاستفادة أيضًا من الإكمال التلقائي في بيئة التطوير المتكاملة (IDE).<br><br> - [تكوين TypeScript](https://intlayer.org/doc/environment/vite-and-react#configure-typescript) |
56
56
  | <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/config_file.png?raw=true" alt="ميزة" width="700"> | **إعداد مبسط**<br><br>ابدأ بسرعة مع أقل قدر من التكوين. قم بضبط الإعدادات الخاصة بالتدويل، التوجيه، الذكاء الاصطناعي، البناء، وإدارة المحتوى بسهولة.<br><br> - [استكشاف تكامل Next.js](https://intlayer.org/doc/environment/nextjs) |
@@ -0,0 +1,137 @@
1
+ ---
2
+ createdAt: 2026-01-06
3
+ updatedAt: 2026-01-06
4
+ title: CI-Befehl
5
+ description: Erfahren Sie, wie Sie den Intlayer CI-Befehl verwenden, um Intlayer-Befehle mit automatisch injizierten Anmeldedaten in CI/CD-Pipelines und Monorepos auszuführen.
6
+ keywords:
7
+ - CI
8
+ - CI/CD
9
+ - Automatisierung
10
+ - Monorepo
11
+ - Anmeldedaten
12
+ - CLI
13
+ - Intlayer
14
+ slugs:
15
+ - doc
16
+ - concept
17
+ - cli
18
+ - ci
19
+ history:
20
+ - version: 7.5.11
21
+ date: 2026-01-06
22
+ changes: CI-Befehl hinzufügen
23
+ ---
24
+
25
+ # CI-Befehl
26
+
27
+ ```bash
28
+ npx intlayer ci <command...>
29
+ ```
30
+
31
+ Der CI-Befehl ist für Automatisierung und CI/CD-Pipelines konzipiert. Er injiziert automatisch Anmeldedaten aus der Umgebungsvariable `INTLAYER_PROJECT_CREDENTIALS` und kann Intlayer-Befehle über mehrere Projekte in einem Monorepo ausführen.
32
+
33
+ ## Funktionsweise
34
+
35
+ Der CI-Befehl arbeitet in zwei Modi:
36
+
37
+ 1. **Einzelprojektmodus**: Wenn das aktuelle Arbeitsverzeichnis mit einem der Projektpfade in `INTLAYER_PROJECT_CREDENTIALS` übereinstimmt, führt er den Befehl nur für dieses spezifische Projekt aus.
38
+
39
+ 2. **Iterationsmodus**: Wenn kein spezifischer Projektkontext erkannt wird, iteriert er über alle konfigurierten Projekte und führt den Befehl für jedes aus.
40
+
41
+ ## Umgebungsvariable
42
+
43
+ Der Befehl erfordert, dass die Umgebungsvariable `INTLAYER_PROJECT_CREDENTIALS` gesetzt ist. Diese Variable sollte ein JSON-Objekt enthalten, das Projektpfade ihren Anmeldedaten zuordnet:
44
+
45
+ ```json
46
+ {
47
+ "packages/app": {
48
+ "clientId": "your-client-id-1",
49
+ "clientSecret": "your-client-secret-1"
50
+ },
51
+ "packages/admin": {
52
+ "clientId": "your-client-id-2",
53
+ "clientSecret": "your-client-secret-2"
54
+ }
55
+ }
56
+ ```
57
+
58
+ ## Paketmanager-Erkennung
59
+
60
+ Der CI-Befehl erkennt automatisch, welcher Paketmanager verwendet wird (npm, yarn, pnpm oder bun), basierend auf der Umgebungsvariable `npm_config_user_agent`, und verwendet den entsprechenden Befehl zur Ausführung von Intlayer.
61
+
62
+ ## Argumente
63
+
64
+ - **`<command...>`**: Der auszuführende Intlayer-Befehl (z. B. `fill`, `push`, `build`). Sie können jeden Intlayer-Befehl und seine Argumente übergeben.
65
+
66
+ > Beispiel: `npx intlayer ci fill --verbose`
67
+ >
68
+ > Beispiel: `npx intlayer ci push`
69
+ >
70
+ > Beispiel: `npx intlayer ci build`
71
+
72
+ ## Beispiele
73
+
74
+ ### Befehl im Einzelprojektmodus ausführen
75
+
76
+ Wenn Sie sich in einem Projektverzeichnis befinden, das mit einem der Pfade in `INTLAYER_PROJECT_CREDENTIALS` übereinstimmt:
77
+
78
+ ```bash
79
+ cd packages/app
80
+ npx intlayer ci fill
81
+ ```
82
+
83
+ Dies führt den Befehl `fill` mit automatisch injizierten Anmeldedaten für das Projekt `packages/app` aus.
84
+
85
+ ### Befehl für alle Projekte ausführen
86
+
87
+ Wenn Sie sich in einem Verzeichnis befinden, das mit keinem Projektpfad übereinstimmt, iteriert der Befehl über alle konfigurierten Projekte:
88
+
89
+ ```bash
90
+ cd /path/to/monorepo
91
+ npx intlayer ci push
92
+ ```
93
+
94
+ Dies führt den Befehl `push` für jedes in `INTLAYER_PROJECT_CREDENTIALS` konfigurierte Projekt aus.
95
+
96
+ ### Zusätzliche Flags übergeben
97
+
98
+ Sie können beliebige Flags an den zugrunde liegenden Intlayer-Befehl übergeben:
99
+
100
+ ```bash
101
+ npx intlayer ci fill --verbose --mode complete
102
+ ```
103
+
104
+ ### Verwendung in CI/CD-Pipelines
105
+
106
+ In Ihrer CI/CD-Konfiguration (z. B. GitHub Actions, GitLab CI) setzen Sie `INTLAYER_PROJECT_CREDENTIALS` als Geheimnis:
107
+
108
+ ```yaml
109
+ # GitHub Actions Beispiel
110
+ env:
111
+ INTLAYER_PROJECT_CREDENTIALS: ${{ secrets.INTLAYER_PROJECT_CREDENTIALS }}
112
+
113
+ steps:
114
+ - name: Wörterbücher füllen
115
+ run: npx intlayer ci fill
116
+ ```
117
+
118
+ ## Fehlerbehandlung
119
+
120
+ - Wenn `INTLAYER_PROJECT_CREDENTIALS` nicht gesetzt ist, beendet sich der Befehl mit einem Fehler.
121
+ - Wenn `INTLAYER_PROJECT_CREDENTIALS` kein gültiges JSON ist, beendet sich der Befehl mit einem Fehler.
122
+ - Wenn ein Projektpfad nicht existiert, wird er mit einer Warnung übersprungen.
123
+ - Wenn ein Projekt fehlschlägt, beendet sich der Befehl mit einem Statuscode ungleich null.
124
+
125
+ ## Anwendungsfälle
126
+
127
+ - **Monorepo-Automatisierung**: Intlayer-Befehle über mehrere Projekte in einem Monorepo ausführen
128
+ - **CI/CD-Pipelines**: Automatisierung der Wörterbuchverwaltung in Continuous-Integration-Workflows
129
+ - **Massenoperationen**: Dieselbe Operation gleichzeitig für mehrere Intlayer-Projekte durchführen
130
+ - **Geheimnisverwaltung**: Sichere Verwaltung von Anmeldedaten für mehrere Projekte mithilfe von Umgebungsvariablen
131
+
132
+ ## Sicherheitsbest Practices
133
+
134
+ - Speichern Sie `INTLAYER_PROJECT_CREDENTIALS` als verschlüsselte Geheimnisse in Ihrer CI/CD-Plattform
135
+ - Committen Sie niemals Anmeldedaten in die Versionskontrolle
136
+ - Verwenden Sie umgebungsspezifische Anmeldedaten für verschiedene Bereitstellungsumgebungen
137
+ - Rotieren Sie Anmeldedaten regelmäßig