create-ng-tailwind 3.1.0 → 4.0.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +81 -350
  2. package/README.md +93 -157
  3. package/lib/cli/index.js +29 -3
  4. package/lib/cli/interactive.js +26 -1
  5. package/lib/managers/ProjectManager.js +0 -4
  6. package/lib/templates/base/components.js +243 -0
  7. package/lib/templates/base/index.js +207 -0
  8. package/lib/templates/base/infrastructure.js +314 -0
  9. package/lib/templates/base/linting.js +359 -0
  10. package/lib/templates/base/pwa.js +103 -0
  11. package/lib/templates/base/services.js +362 -0
  12. package/lib/templates/blog/app.js +250 -0
  13. package/lib/templates/blog/components.js +360 -0
  14. package/lib/templates/blog/i18n.js +77 -0
  15. package/lib/templates/blog/index.js +126 -0
  16. package/lib/templates/blog/pages.js +554 -0
  17. package/lib/templates/blog/services.js +390 -0
  18. package/lib/templates/dashboard/app.js +320 -0
  19. package/lib/templates/dashboard/charts.js +305 -0
  20. package/lib/templates/dashboard/components.js +410 -0
  21. package/lib/templates/dashboard/i18n.js +340 -0
  22. package/lib/templates/dashboard/index.js +141 -0
  23. package/lib/templates/dashboard/layout.js +310 -0
  24. package/lib/templates/dashboard/pages.js +681 -0
  25. package/lib/templates/ecommerce/app.js +315 -0
  26. package/lib/templates/ecommerce/components.js +496 -0
  27. package/lib/templates/ecommerce/i18n.js +389 -0
  28. package/lib/templates/ecommerce/index.js +152 -0
  29. package/lib/templates/ecommerce/layout.js +270 -0
  30. package/lib/templates/ecommerce/pages.js +969 -0
  31. package/lib/templates/ecommerce/services.js +300 -0
  32. package/lib/templates/index.js +12 -0
  33. package/lib/templates/landing/index.js +1117 -0
  34. package/lib/templates/portfolio/index.js +1160 -0
  35. package/lib/templates/saas/index.js +1371 -0
  36. package/lib/templates/starter/app.js +364 -0
  37. package/lib/templates/starter/i18n.js +856 -0
  38. package/lib/templates/starter/index.js +52 -4060
  39. package/lib/templates/starter/layout.js +852 -0
  40. package/lib/templates/starter/pages.js +1241 -0
  41. package/package.json +1 -1
  42. package/lib/templates/starter/features.js +0 -867
  43. package/lib/utils/ai-config.js +0 -641
  44. /package/lib/templates/{starter → base}/advanced-features.js +0 -0
  45. /package/lib/templates/{starter → base}/seo-assets.js +0 -0
  46. /package/lib/templates/{starter → base}/seo-features.js +0 -0
  47. /package/lib/templates/{starter → base}/ui-features.js +0 -0
@@ -0,0 +1,856 @@
1
+ const fs = require("fs-extra");
2
+ const path = require("path");
3
+
4
+ /**
5
+ * Create i18n (translations) for starter template
6
+ */
7
+ async function createI18n(config) {
8
+ // Create Translation Service
9
+ const translationService = `import { Injectable, inject, signal, effect, PLATFORM_ID } from '@angular/core';
10
+ import { isPlatformBrowser } from '@angular/common';
11
+ import { TranslateService } from '@ngx-translate/core';
12
+ import { StorageService } from '@core/services/storage.service';
13
+
14
+ export type SupportedLanguage = 'en' | 'ar';
15
+
16
+ export interface LanguageOption {
17
+ code: SupportedLanguage;
18
+ name: string;
19
+ nativeName: string;
20
+ dir: 'ltr' | 'rtl';
21
+ flag: string;
22
+ }
23
+
24
+ @Injectable({
25
+ providedIn: 'root'
26
+ })
27
+ export class TranslationService {
28
+ private translateService = inject(TranslateService);
29
+ private storage = inject(StorageService);
30
+ private platformId = inject(PLATFORM_ID);
31
+ private isBrowser = isPlatformBrowser(this.platformId);
32
+
33
+ // Reactive current language
34
+ public currentLang = signal<SupportedLanguage>('en');
35
+
36
+ // Reactive text direction
37
+ public textDirection = signal<'ltr' | 'rtl'>('ltr');
38
+
39
+ // Available languages
40
+ public readonly languages: LanguageOption[] = [
41
+ {
42
+ code: 'en',
43
+ name: 'English',
44
+ nativeName: 'English',
45
+ dir: 'ltr',
46
+ flag: '🇺🇸'
47
+ },
48
+ {
49
+ code: 'ar',
50
+ name: 'Arabic',
51
+ nativeName: 'العربية',
52
+ dir: 'rtl',
53
+ flag: '🇸🇦'
54
+ }
55
+ ];
56
+
57
+ constructor() {
58
+ // Initialize translation service
59
+ this.translateService.setDefaultLang('en');
60
+
61
+ // Load saved language or detect browser language
62
+ const savedLang = this.getSavedLanguage();
63
+ const browserLang = this.translateService.getBrowserLang() as SupportedLanguage;
64
+ const initialLang = savedLang || (this.isSupportedLanguage(browserLang) ? browserLang : 'en');
65
+
66
+ this.setLanguage(initialLang);
67
+
68
+ // Effect to update document direction when language changes (browser only)
69
+ if (this.isBrowser) {
70
+ effect(() => {
71
+ const dir = this.textDirection();
72
+ document.documentElement.setAttribute('dir', dir);
73
+ document.documentElement.setAttribute('lang', this.currentLang());
74
+ });
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Change the current language
80
+ */
81
+ setLanguage(lang: SupportedLanguage): void {
82
+ if (!this.isSupportedLanguage(lang)) {
83
+ console.warn(\`Language '\${lang}' is not supported. Falling back to 'en'.\`);
84
+ lang = 'en';
85
+ }
86
+
87
+ this.translateService.use(lang);
88
+ this.currentLang.set(lang);
89
+
90
+ const languageOption = this.languages.find(l => l.code === lang);
91
+ if (languageOption) {
92
+ this.textDirection.set(languageOption.dir);
93
+ }
94
+
95
+ this.saveLanguage(lang);
96
+ }
97
+
98
+ /**
99
+ * Get current language
100
+ */
101
+ getCurrentLanguage(): SupportedLanguage {
102
+ return this.currentLang();
103
+ }
104
+
105
+ /**
106
+ * Get language option by code
107
+ */
108
+ getLanguageOption(code: SupportedLanguage): LanguageOption | undefined {
109
+ return this.languages.find(lang => lang.code === code);
110
+ }
111
+
112
+ /**
113
+ * Check if language is supported
114
+ */
115
+ isSupportedLanguage(lang: string): lang is SupportedLanguage {
116
+ return ['en', 'ar'].includes(lang);
117
+ }
118
+
119
+ /**
120
+ * Toggle between English and Arabic
121
+ */
122
+ toggleLanguage(): void {
123
+ const newLang: SupportedLanguage = this.currentLang() === 'en' ? 'ar' : 'en';
124
+ this.setLanguage(newLang);
125
+ }
126
+
127
+ /**
128
+ * Get instant translation
129
+ */
130
+ instant(key: string, params?: object): string {
131
+ return this.translateService.instant(key, params);
132
+ }
133
+
134
+ /**
135
+ * Get translation as observable
136
+ */
137
+ get(key: string | string[], params?: object) {
138
+ return this.translateService.get(key, params);
139
+ }
140
+
141
+ /**
142
+ * Save language preference to storage
143
+ */
144
+ private saveLanguage(lang: SupportedLanguage): void {
145
+ this.storage.setItem('preferred_language', lang);
146
+ }
147
+
148
+ /**
149
+ * Get saved language from storage
150
+ */
151
+ private getSavedLanguage(): SupportedLanguage | null {
152
+ const saved = this.storage.getItem('preferred_language');
153
+ return saved && this.isSupportedLanguage(saved) ? saved : null;
154
+ }
155
+ }`;
156
+
157
+ await fs.writeFile(
158
+ path.join(config.fullPath, "src/app/core/i18n/translation.service.ts"),
159
+ translationService
160
+ );
161
+
162
+ // Create English translations
163
+ const enTranslations = {
164
+ app: {
165
+ title: config.projectName,
166
+ welcome: "Welcome to {{name}}",
167
+ description:
168
+ "A professional Angular starter template with Tailwind CSS",
169
+ },
170
+ nav: {
171
+ home: "Home",
172
+ about: "About",
173
+ contact: "Contact",
174
+ login: "Sign In",
175
+ register: "Get Started",
176
+ logout: "Sign Out",
177
+ profile: "Profile Settings",
178
+ account: "Account Settings",
179
+ },
180
+ home: {
181
+ hero: {
182
+ title: "Welcome to {{projectName}}",
183
+ subtitle:
184
+ "A professional Angular starter template with Tailwind CSS. Built with modern best practices and ready to scale.",
185
+ button: "Get Started",
186
+ learnMore: "Learn More",
187
+ },
188
+ features: {
189
+ title: "Modern Angular Features",
190
+ subtitle:
191
+ "Everything you need to build professional web applications.",
192
+ standalone: {
193
+ title: "Standalone Components",
194
+ description: "Modern Angular architecture without NgModules",
195
+ },
196
+ tailwind: {
197
+ title: "Tailwind CSS",
198
+ description: "Utility-first CSS framework for rapid UI development",
199
+ },
200
+ typescript: {
201
+ title: "TypeScript",
202
+ description: "Full type safety and enhanced developer experience",
203
+ },
204
+ },
205
+ techStack: {
206
+ title:
207
+ "Leveraging the latest tools and frameworks for optimal performance",
208
+ angular: {
209
+ title: "Angular 20+",
210
+ description:
211
+ "Modern standalone components with signals for reactive state management",
212
+ },
213
+ tailwind: {
214
+ title: "Tailwind CSS v4",
215
+ description:
216
+ "Utility-first CSS framework with modern PostCSS configuration",
217
+ },
218
+ typescript: {
219
+ title: "TypeScript",
220
+ description:
221
+ "Strongly-typed interfaces and models for enhanced developer experience",
222
+ },
223
+ },
224
+ readyToStart: {
225
+ title: "Ready to Start Building?",
226
+ subtitle: "Explore other pages or get in touch with us to learn more",
227
+ viewHome: "View Home",
228
+ contactUs: "Contact Us",
229
+ },
230
+ productionReady: {
231
+ sectionTitle: "What's Included in This Starter Template",
232
+ title:
233
+ "A production-ready Angular application with 20+ pre-configured features, services, and components",
234
+ modernArchitecture: {
235
+ title: "Modern Architecture",
236
+ description:
237
+ "Standalone components, Signals, Zoneless support, Angular 20+",
238
+ },
239
+ i18n: {
240
+ title: "i18n Translation",
241
+ description:
242
+ "English & Arabic with RTL support, language switcher in header",
243
+ },
244
+ interceptors: {
245
+ title: "HTTP Interceptors",
246
+ description:
247
+ "Auth, Error handling, Loading state, Response caching (5min TTL)",
248
+ },
249
+ tailwind: {
250
+ title: "Tailwind CSS v4",
251
+ description:
252
+ "Modern PostCSS setup, responsive utilities, dark mode ready",
253
+ },
254
+ uiComponents: {
255
+ title: "UI Components",
256
+ description:
257
+ "Button, Card, Spinner, Toast, Modal with full customization",
258
+ },
259
+ typeSafe: {
260
+ title: "Type-Safe",
261
+ description: "TypeScript interfaces, models, strongly-typed services",
262
+ },
263
+ },
264
+ coreServices: {
265
+ title: "Core Services (src/app/core/)",
266
+ authService: "AuthService - Authentication & user management",
267
+ apiService: "ApiService - Centralized HTTP request handling",
268
+ toastService:
269
+ "ToastService - Notification system (success, error, warning, info)",
270
+ modalService: "ModalService - Dialog system with confirm & alert",
271
+ loadingService: "LoadingService - Global loading state with signals",
272
+ cacheService: "CacheService - Response caching with TTL",
273
+ storageService: "StorageService - LocalStorage wrapper with type safety",
274
+ i18nService: "i18nService - Internationalization management",
275
+ },
276
+ sharedComponents: {
277
+ title: "Shared Components (src/app/shared/)",
278
+ button: "ButtonComponent - Variants: primary, secondary, danger",
279
+ card: "CardComponent - Flexible container with title & shadow",
280
+ spinner: "LoadingSpinnerComponent - Animated loading indicator",
281
+ toast: "ToastComponent - Auto-dismiss notifications",
282
+ modal: "ModalComponent - Accessible dialog with sizes",
283
+ pipes: "Pipes - Truncate, TimeAgo",
284
+ directives: "Directives - ClickOutside, Tooltip",
285
+ },
286
+ preConfigured: {
287
+ title: "Pre-Configured Packages & Tools",
288
+ subtitle:
289
+ "Production-ready dependencies and development tools included",
290
+ coreDependencies: "Core Dependencies",
291
+ developmentTools: "Development Tools",
292
+ latest: "Latest",
293
+ i18n: "i18n",
294
+ iconLibrary: "Icon library",
295
+ linting: "Linting",
296
+ formatting: "Formatting",
297
+ gitHooks: "Git hooks",
298
+ typeSafety: "Type safety",
299
+ serviceWorker: "Service worker",
300
+ },
301
+ pathAliases: {
302
+ title: "TypeScript Path Aliases (tsconfig.json)",
303
+ core: "@core/* → src/app/core/*",
304
+ shared: "@shared/* → src/app/shared/*",
305
+ features: "@features/* → src/app/features/*",
306
+ environments: "@environments/* → src/environments/*",
307
+ },
308
+ projectStructure: {
309
+ title: "Well-Organized Project Structure",
310
+ subtitle: "Clean architecture following Angular best practices",
311
+ coreServices: "services/ (8 services)",
312
+ guards: "guards/ (auth guard)",
313
+ interceptors: "interceptors/ (4 types)",
314
+ i18n: "i18n/ (translation system)",
315
+ components: "components/ (5 components)",
316
+ pipes: "pipes/ (2 pipes)",
317
+ directives: "directives/ (2 directives)",
318
+ models: "models/ (TypeScript interfaces)",
319
+ home: "home/",
320
+ about: "about/",
321
+ contact: "contact/",
322
+ auth: "auth/ (login, register, forgot)",
323
+ mainLayout: "main-layout/ (header + footer)",
324
+ authLayout: "auth-layout/ (auth pages)",
325
+ },
326
+ interactiveExamples: {
327
+ title: "Try Interactive Examples",
328
+ subtitle:
329
+ "Test the Toast and Modal services included in this starter template",
330
+ toastNotifications: {
331
+ title: "Toast Notifications",
332
+ subtitle: "Auto-dismiss alerts with 4 types",
333
+ description:
334
+ "Click any button to see different toast notification types:",
335
+ success: "Success",
336
+ error: "Error",
337
+ warning: "Warning",
338
+ info: "Info",
339
+ },
340
+ modalDialogs: {
341
+ title: "Modal Dialogs",
342
+ subtitle: "Accessible & responsive dialogs",
343
+ description:
344
+ "Test confirmation and alert modals with transitions:",
345
+ showConfirm: "Show Confirm Dialog",
346
+ showAlert: "Show Alert Dialog",
347
+ },
348
+ proTip: {
349
+ title: "Pro Tip",
350
+ description:
351
+ "These services are fully typed and can be injected anywhere in your app. Check src/app/core/services/ to see the implementation.",
352
+ },
353
+ },
354
+ readyToBuild: {
355
+ title: "Ready to Build Something Amazing?",
356
+ subtitle:
357
+ "Explore the other pages to see forms, routing, and authentication UI in action",
358
+ learnMore: "Learn More",
359
+ },
360
+ },
361
+ about: {
362
+ title: "About {{projectName}}",
363
+ subtitle:
364
+ "A modern Angular starter template built with best practices and developer experience in mind.",
365
+ overview: {
366
+ title: "Project Overview",
367
+ paragraph1:
368
+ "This starter template provides a solid foundation for building modern Angular applications with Tailwind CSS, including essential components, services, and best practices.",
369
+ paragraph2:
370
+ "Built with the latest Angular features including standalone components, signals, and optimized for performance and developer experience.",
371
+ },
372
+ features: {
373
+ title: "Features Included",
374
+ standalone: "Standalone Angular components",
375
+ tailwind: "Tailwind CSS integration",
376
+ responsive: "Responsive design",
377
+ typescript: "TypeScript ready",
378
+ production: "Production optimized",
379
+ },
380
+ techStack: {
381
+ title: "Built With Modern Technologies",
382
+ },
383
+ },
384
+ contact: {
385
+ title: "Get in Touch",
386
+ subtitle:
387
+ "Have questions? We'd love to hear from you. Send us a message and we'll respond as soon as possible.",
388
+ form: {
389
+ title: "Send us a message",
390
+ description: "Fill out the form below and we'll get back to you soon",
391
+ name: "Full Name",
392
+ email: "Email Address",
393
+ subject: "Subject",
394
+ message: "Message",
395
+ submit: "Send Message",
396
+ sending: "Sending...",
397
+ success: "Thank you for your message! We'll get back to you soon.",
398
+ errors: {
399
+ nameRequired: "Name is required",
400
+ nameMinLength: "Name must be at least 2 characters",
401
+ emailRequired: "Email is required",
402
+ emailInvalid: "Please enter a valid email",
403
+ subjectRequired: "Subject is required",
404
+ messageRequired: "Message is required",
405
+ messageMinLength: "Message must be at least 10 characters",
406
+ },
407
+ },
408
+ info: {
409
+ title: "Contact Information",
410
+ description:
411
+ "We're here to help and answer any question you might have",
412
+ email: {
413
+ label: "Email",
414
+ description: "We'll respond within 24 hours",
415
+ },
416
+ location: {
417
+ label: "Location",
418
+ value: "Remote & Global",
419
+ description: "Working across all time zones",
420
+ },
421
+ responseTime: {
422
+ label: "Response Time",
423
+ value: "24 hours",
424
+ description: "Usually much faster",
425
+ },
426
+ },
427
+ help: {
428
+ title: "Helpful Resources",
429
+ subtitle:
430
+ "Have questions about the starter template? Check out these resources:",
431
+ links: {
432
+ angular: "Angular Documentation",
433
+ tailwind: "Tailwind CSS Guide",
434
+ github: "GitHub Repository",
435
+ },
436
+ },
437
+ },
438
+ auth: {
439
+ layout: {
440
+ welcome: "Welcome back! Please sign in to continue.",
441
+ copyright: "© {{year}} {{name}}. All rights reserved.",
442
+ },
443
+ login: {
444
+ title: "Sign In",
445
+ subtitle: "Enter your credentials to access your account",
446
+ email: "Email Address",
447
+ password: "Password",
448
+ rememberMe: "Remember me",
449
+ forgotPassword: "Forgot password?",
450
+ submit: "Sign In",
451
+ signing: "Signing in...",
452
+ noAccount: "Don't have an account?",
453
+ createAccount: "Create one here",
454
+ showPassword: "Show password",
455
+ hidePassword: "Hide password",
456
+ },
457
+ register: {
458
+ title: "Create Account",
459
+ subtitle: "Sign up to get started",
460
+ firstName: "First Name",
461
+ lastName: "Last Name",
462
+ email: "Email",
463
+ password: "Password",
464
+ submit: "Create Account",
465
+ hasAccount: "Already have an account?",
466
+ },
467
+ forgot: {
468
+ title: "Forgot Password",
469
+ subtitle: "Enter your email to reset password",
470
+ email: "Email Address",
471
+ submit: "Send Reset Link",
472
+ backToLogin: "Back to Sign In",
473
+ },
474
+ validation: {
475
+ emailRequired: "Email is required",
476
+ emailInvalid: "Please enter a valid email",
477
+ passwordRequired: "Password is required",
478
+ passwordMinLength: "Password must be at least 6 characters",
479
+ },
480
+ },
481
+ footer: {
482
+ description:
483
+ "Built with Angular and Tailwind CSS. A modern, fast, and responsive web application starter template.",
484
+ quickLinks: "Quick Links",
485
+ builtWith: "Built With",
486
+ copyright: "© {{year}} {{name}}. All rights reserved.",
487
+ },
488
+ language: {
489
+ select: "Select Language",
490
+ english: "English",
491
+ arabic: "العربية",
492
+ },
493
+ };
494
+
495
+ await fs.writeFile(
496
+ path.join(config.fullPath, "public/assets/i18n/en.json"),
497
+ JSON.stringify(enTranslations, null, 2)
498
+ );
499
+
500
+ // Create Arabic translations
501
+ const arTranslations = {
502
+ app: {
503
+ title: config.projectName,
504
+ welcome: "مرحباً بك في {{name}}",
505
+ description: "قالب احترافي لتطبيقات Angular مع Tailwind CSS",
506
+ },
507
+ nav: {
508
+ home: "الرئيسية",
509
+ about: "حول",
510
+ contact: "اتصل بنا",
511
+ login: "تسجيل الدخول",
512
+ register: "ابدأ الآن",
513
+ logout: "تسجيل الخروج",
514
+ profile: "إعدادات الملف الشخصي",
515
+ account: "إعدادات الحساب",
516
+ },
517
+ home: {
518
+ hero: {
519
+ title: "مرحباً بك في {{projectName}}",
520
+ subtitle:
521
+ "قالب احترافي لتطبيقات Angular مع Tailwind CSS. مبني بأحدث الممارسات وجاهز للتوسع.",
522
+ button: "ابدأ الآن",
523
+ learnMore: "معرفة المزيد",
524
+ },
525
+ features: {
526
+ title: "ميزات Angular الحديثة",
527
+ subtitle: "كل ما تحتاجه لبناء تطبيقات ويب احترافية.",
528
+ standalone: {
529
+ title: "مكونات مستقلة",
530
+ description: "بنية Angular الحديثة بدون NgModules",
531
+ },
532
+ tailwind: {
533
+ title: "Tailwind CSS",
534
+ description: "إطار عمل CSS سريع للتطوير",
535
+ },
536
+ typescript: {
537
+ title: "TypeScript",
538
+ description: "الأمان الكامل للأنواع وتجربة تطوير محسّنة",
539
+ },
540
+ },
541
+ techStack: {
542
+ title: "الاستفادة من أحدث الأدوات والأطر لتحسين الأداء",
543
+ angular: {
544
+ title: "Angular 20+",
545
+ description:
546
+ "مكونات مستقلة حديثة مع الإشارات لإدارة الحالة التفاعلية",
547
+ },
548
+ tailwind: {
549
+ title: "Tailwind CSS v4",
550
+ description: "إطار عمل CSS مبني على المرافق مع إعداد PostCSS حديث",
551
+ },
552
+ typescript: {
553
+ title: "TypeScript",
554
+ description: "واجهات ونماذج مُكتوبة بقوة لتحسين تجربة المطور",
555
+ },
556
+ },
557
+ readyToStart: {
558
+ title: "جاهز لبدء البناء؟",
559
+ subtitle: "استكشف الصفحات الأخرى أو تواصل معنا لمعرفة المزيد",
560
+ viewHome: "عرض الرئيسية",
561
+ contactUs: "تواصل معنا",
562
+ },
563
+ productionReady: {
564
+ sectionTitle: "ما هو مُضمن في هذا القالب",
565
+ title:
566
+ "تطبيق Angular جاهز للإنتاج مع 20+ ميزة وخدمة ومكون مُعد مسبقاً",
567
+ modernArchitecture: {
568
+ title: "معمارية حديثة",
569
+ description: "مكونات مستقلة، إشارات، دعم بدون منطقة، Angular 20+",
570
+ },
571
+ i18n: {
572
+ title: "ترجمة i18n",
573
+ description: "الإنجليزية والعربية مع دعم RTL، مبدل اللغة في الرأس",
574
+ },
575
+ interceptors: {
576
+ title: "مُعترِضات HTTP",
577
+ description:
578
+ "المصادقة، معالجة الأخطاء، حالة التحميل، تخزين الاستجابة مؤقتاً (5 دقائق TTL)",
579
+ },
580
+ tailwind: {
581
+ title: "Tailwind CSS v4",
582
+ description: "إعداد PostCSS حديث، مرافق متجاوبة، جاهز للوضع المظلم",
583
+ },
584
+ uiComponents: {
585
+ title: "مكونات واجهة المستخدم",
586
+ description: "زر، بطاقة، دوار، تنبيه، نافذة منبثقة مع تخصيص كامل",
587
+ },
588
+ typeSafe: {
589
+ title: "آمن النوع",
590
+ description: "واجهات TypeScript، نماذج، خدمات مُكتوبة بقوة",
591
+ },
592
+ },
593
+ coreServices: {
594
+ title: "الخدمات الأساسية (src/app/core/)",
595
+ authService: "AuthService - المصادقة وإدارة المستخدمين",
596
+ apiService: "ApiService - معالجة طلبات HTTP مركزية",
597
+ toastService:
598
+ "ToastService - نظام الإشعارات (نجاح، خطأ، تحذير، معلومات)",
599
+ modalService: "ModalService - نظام الحوار مع التأكيد والتنبيه",
600
+ loadingService: "LoadingService - حالة التحميل العامة مع الإشارات",
601
+ cacheService: "CacheService - تخزين الاستجابة مؤقتاً مع TTL",
602
+ storageService: "StorageService - غلاف LocalStorage مع أمان النوع",
603
+ i18nService: "i18nService - إدارة الترجمة",
604
+ },
605
+ sharedComponents: {
606
+ title: "المكونات المشتركة (src/app/shared/)",
607
+ button: "ButtonComponent - متغيرات: أساسي، ثانوي، خطر",
608
+ card: "CardComponent - حاوية مرنة مع عنوان وظل",
609
+ spinner: "LoadingSpinnerComponent - مؤشر تحميل متحرك",
610
+ toast: "ToastComponent - إشعارات إغلاق تلقائي",
611
+ modal: "ModalComponent - حوار قابل للوصول بأحجام",
612
+ pipes: "الأنابيب - قطع، منذ",
613
+ directives: "التوجيهات - خارج النقر، تلميح",
614
+ },
615
+ preConfigured: {
616
+ title: "الحزم والأدوات المُعدة مسبقاً",
617
+ subtitle: "التبعيات وأدوات التطوير الجاهزة للإنتاج مُضمنة",
618
+ coreDependencies: "التبعيات الأساسية",
619
+ developmentTools: "أدوات التطوير",
620
+ latest: "الأحدث",
621
+ i18n: "i18n",
622
+ iconLibrary: "مكتبة الأيقونات",
623
+ linting: "الفحص",
624
+ formatting: "التنسيق",
625
+ gitHooks: "خطافات Git",
626
+ typeSafety: "أمان النوع",
627
+ serviceWorker: "عامل الخدمة",
628
+ },
629
+ pathAliases: {
630
+ title: "أسماء مسارات TypeScript (tsconfig.json)",
631
+ core: "@core/* → src/app/core/*",
632
+ shared: "@shared/* → src/app/shared/*",
633
+ features: "@features/* → src/app/features/*",
634
+ environments: "@environments/* → src/environments/*",
635
+ },
636
+ projectStructure: {
637
+ title: "هيكل المشروع منظم جيداً",
638
+ subtitle: "معمارية نظيفة تتبع أفضل ممارسات Angular",
639
+ coreServices: "services/ (8 خدمات)",
640
+ guards: "guards/ (حارس المصادقة)",
641
+ interceptors: "interceptors/ (4 أنواع)",
642
+ i18n: "i18n/ (نظام الترجمة)",
643
+ components: "components/ (5 مكونات)",
644
+ pipes: "pipes/ (2 أنابيب)",
645
+ directives: "directives/ (2 توجيهات)",
646
+ models: "models/ (واجهات TypeScript)",
647
+ home: "home/",
648
+ about: "about/",
649
+ contact: "contact/",
650
+ auth: "auth/ (تسجيل دخول، تسجيل، نسيان)",
651
+ mainLayout: "main-layout/ (رأس + تذييل)",
652
+ authLayout: "auth-layout/ (صفحات المصادقة)",
653
+ },
654
+ interactiveExamples: {
655
+ title: "جرب الأمثلة التفاعلية",
656
+ subtitle: "اختبر خدمات Toast و Modal المُضمنة في هذا القالب",
657
+ toastNotifications: {
658
+ title: "إشعارات Toast",
659
+ subtitle: "تنبيهات إغلاق تلقائي مع 4 أنواع",
660
+ description: "انقر على أي زر لرؤية أنواع مختلفة من إشعارات Toast:",
661
+ success: "نجح",
662
+ error: "خطأ",
663
+ warning: "تحذير",
664
+ info: "معلومات",
665
+ },
666
+ modalDialogs: {
667
+ title: "حوارات النافذة المنبثقة",
668
+ subtitle: "حوارات قابلة للوصول ومتجاوبة",
669
+ description: "اختبر حوارات التأكيد والتنبيه مع الانتقالات:",
670
+ showConfirm: "إظهار حوار التأكيد",
671
+ showAlert: "إظهار حوار التنبيه",
672
+ },
673
+ proTip: {
674
+ title: "نصيحة احترافية",
675
+ description:
676
+ "هذه الخدمات مُكتوبة بالكامل ويمكن حقنها في أي مكان في تطبيقك. تحقق من src/app/core/services/ لرؤية التنفيذ.",
677
+ },
678
+ },
679
+ readyToBuild: {
680
+ title: "جاهز لبناء شيء مذهل؟",
681
+ subtitle:
682
+ "استكشف الصفحات الأخرى لرؤية النماذج والتوجيه وواجهة المصادقة في العمل",
683
+ learnMore: "معرفة المزيد",
684
+ },
685
+ },
686
+ about: {
687
+ title: "حول {{projectName}}",
688
+ subtitle:
689
+ "قالب Angular حديث مبني بأفضل الممارسات وتجربة المطور في الاعتبار.",
690
+ overview: {
691
+ title: "نظرة عامة على المشروع",
692
+ paragraph1:
693
+ "يوفر هذا القالب أساساً قوياً لبناء تطبيقات Angular الحديثة مع Tailwind CSS، بما في ذلك المكونات الأساسية والخدمات وأفضل الممارسات.",
694
+ paragraph2:
695
+ "مبني بأحدث ميزات Angular بما في ذلك المكونات المستقلة والإشارات، ومُحسّن للأداء وتجربة المطور.",
696
+ },
697
+ features: {
698
+ title: "الميزات المتضمنة",
699
+ standalone: "مكونات Angular المستقلة",
700
+ tailwind: "تكامل Tailwind CSS",
701
+ responsive: "تصميم متجاوب",
702
+ typescript: "جاهز لـ TypeScript",
703
+ production: "مُحسّن للإنتاج",
704
+ },
705
+ techStack: {
706
+ title: "مبني بأحدث التقنيات",
707
+ },
708
+ },
709
+ contact: {
710
+ title: "تواصل معنا",
711
+ subtitle:
712
+ "هل لديك أسئلة؟ نحب أن نسمع منك. أرسل لنا رسالة وسنرد في أقرب وقت ممكن.",
713
+ form: {
714
+ title: "أرسل لنا رسالة",
715
+ description: "املأ النموذج أدناه وسنعاود الاتصال بك قريباً",
716
+ name: "الاسم الكامل",
717
+ email: "عنوان البريد الإلكتروني",
718
+ subject: "الموضوع",
719
+ message: "الرسالة",
720
+ submit: "إرسال الرسالة",
721
+ sending: "جاري الإرسال...",
722
+ success: "شكراً على رسالتك! سنعاود الاتصال بك قريباً.",
723
+ errors: {
724
+ nameRequired: "الاسم مطلوب",
725
+ nameMinLength: "يجب أن يكون الاسم على الأقل حرفين",
726
+ emailRequired: "البريد الإلكتروني مطلوب",
727
+ emailInvalid: "يرجى إدخال بريد إلكتروني صحيح",
728
+ subjectRequired: "الموضوع مطلوب",
729
+ messageRequired: "الرسالة مطلوبة",
730
+ messageMinLength: "يجب أن تكون الرسالة على الأقل 10 أحرف",
731
+ },
732
+ },
733
+ info: {
734
+ title: "معلومات الاتصال",
735
+ description: "نحن هنا للمساعدة والإجابة على أي سؤال قد يكون لديك",
736
+ email: {
737
+ label: "البريد الإلكتروني",
738
+ description: "سنرد خلال 24 ساعة",
739
+ },
740
+ location: {
741
+ label: "الموقع",
742
+ value: "عن بُعد وعالمي",
743
+ description: "نعمل عبر جميع المناطق الزمنية",
744
+ },
745
+ responseTime: {
746
+ label: "وقت الاستجابة",
747
+ value: "24 ساعة",
748
+ description: "عادة أسرع بكثير",
749
+ },
750
+ },
751
+ help: {
752
+ title: "موارد مفيدة",
753
+ subtitle: "هل لديك أسئلة حول القالب؟ تحقق من هذه الموارد:",
754
+ links: {
755
+ angular: "وثائق Angular",
756
+ tailwind: "دليل Tailwind CSS",
757
+ github: "مستودع GitHub",
758
+ },
759
+ },
760
+ },
761
+ auth: {
762
+ layout: {
763
+ welcome: "مرحبًا بعودتك! يرجى تسجيل الدخول للمتابعة.",
764
+ copyright: "© {{year}} {{name}}. جميع الحقوق محفوظة.",
765
+ },
766
+ login: {
767
+ title: "تسجيل الدخول",
768
+ subtitle: "أدخل بيانات الاعتماد للوصول إلى حسابك",
769
+ email: "عنوان البريد الإلكتروني",
770
+ password: "كلمة المرور",
771
+ rememberMe: "تذكرني",
772
+ forgotPassword: "نسيت كلمة المرور؟",
773
+ submit: "تسجيل الدخول",
774
+ signing: "جاري تسجيل الدخول...",
775
+ noAccount: "ليس لديك حساب؟",
776
+ createAccount: "أنشئ حساباً هنا",
777
+ showPassword: "إظهار كلمة المرور",
778
+ hidePassword: "إخفاء كلمة المرور",
779
+ },
780
+ register: {
781
+ title: "إنشاء حساب",
782
+ subtitle: "سجل للبدء",
783
+ firstName: "الاسم الأول",
784
+ lastName: "اسم العائلة",
785
+ email: "البريد الإلكتروني",
786
+ password: "كلمة المرور",
787
+ submit: "إنشاء حساب",
788
+ hasAccount: "لديك حساب بالفعل؟",
789
+ },
790
+ forgot: {
791
+ title: "نسيت كلمة المرور",
792
+ subtitle: "أدخل بريدك الإلكتروني لإعادة تعيين كلمة المرور",
793
+ email: "عنوان البريد الإلكتروني",
794
+ submit: "إرسال رابط إعادة التعيين",
795
+ backToLogin: "العودة إلى تسجيل الدخول",
796
+ },
797
+ validation: {
798
+ emailRequired: "البريد الإلكتروني مطلوب",
799
+ emailInvalid: "يرجى إدخال بريد إلكتروني صحيح",
800
+ passwordRequired: "كلمة المرور مطلوبة",
801
+ passwordMinLength: "يجب أن تكون كلمة المرور 6 أحرف على الأقل",
802
+ },
803
+ },
804
+ footer: {
805
+ description:
806
+ "مبني بـ Angular و Tailwind CSS. قالب تطبيق ويب حديث وسريع ومتجاوب.",
807
+ quickLinks: "روابط سريعة",
808
+ builtWith: "مبني بـ",
809
+ copyright: "© {{year}} {{name}}. جميع الحقوق محفوظة.",
810
+ },
811
+ language: {
812
+ select: "اختر اللغة",
813
+ english: "English",
814
+ arabic: "العربية",
815
+ },
816
+ };
817
+
818
+ await fs.writeFile(
819
+ path.join(config.fullPath, "public/assets/i18n/ar.json"),
820
+ JSON.stringify(arTranslations, null, 2)
821
+ );
822
+
823
+ // Update package.json to include translation dependencies
824
+ const packageJsonPath = path.join(config.fullPath, "package.json");
825
+ const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
826
+
827
+ const translationDependencies = {
828
+ "@ngx-translate/core": "^15.0.0",
829
+ "@ngx-translate/http-loader": "^8.0.0",
830
+ };
831
+
832
+ packageJson.dependencies = {
833
+ ...packageJson.dependencies,
834
+ ...translationDependencies,
835
+ };
836
+
837
+ await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));
838
+ }
839
+
840
+ /**
841
+ * Install i18n packages
842
+ */
843
+ async function installI18nPackages(config) {
844
+ if (!config.skipInstall) {
845
+ const execa = require("execa");
846
+ await execa.command(
847
+ "npm install @ngx-translate/core@^15.0.0 @ngx-translate/http-loader@^8.0.0 --force",
848
+ {
849
+ cwd: config.fullPath,
850
+ stdio: "pipe",
851
+ }
852
+ );
853
+ }
854
+ }
855
+
856
+ module.exports = { createI18n, installI18nPackages };