2026-04-16-3 add secur ,billing ,documents ,

This commit is contained in:
Hamza-Ayed
2026-04-16 05:36:53 +03:00
parent 47a38d657e
commit 9f2a03a979
20 changed files with 882 additions and 256 deletions
+216 -73
View File
@@ -1,5 +1,7 @@
/**
* i18n Translation Engine
* Localization Engine for Intaleq Map SaaS
* Supports Arabic (RTL) and English (LTR)
* Handles both landing page and dashboard
*/
const i18n = {
@@ -7,29 +9,28 @@ const i18n = {
translations: {
en: {
// Navbar
// Navbar (Landing)
'nav-features': 'Features',
'nav-why': 'Why Us?',
'nav-pricing': 'Pricing',
'nav-launch': 'Launch Dashboard',
'lang-toggle': 'العربية',
// Hero
// Hero (Landing)
'hero-badge': 'Now with 3D Buildings in Jordan & Syria',
'hero-title': 'The Map API That <br> <span class="text-blue-500">Doesn\'t Break</span> The Bank.',
'hero-desc': 'Build premium location-based apps with high-fidelity vector tiles, optimized routing, and 3D buildings. 85% cheaper than Google Maps.',
'hero-cta-start': 'Start Building Free',
'hero-cta-view': 'View Comparison',
// Features
// Features (Landing)
'feat-latency-title': 'Zero Latency',
'feat-latency-desc': 'Our infrastructure is optimized for MENA region, ensuring map tiles load in under 200ms.',
'feat-routing-title': 'Smart Routing',
'feat-routing-desc': 'Enterprise-grade routing engine with support for alternative paths and traffic awareness.',
'feat-geocoding-title': 'Local Geocoding',
'feat-geocoding-desc': 'Highly accurate search for local landmarks and neighborhoods in Jordan & Syria.',
// Dashboard Sidebar
// Sidebar (Dashboard)
'side-dashboard': 'Dashboard',
'side-playground': 'Playground',
'side-analytics': 'Analytics',
@@ -37,116 +38,251 @@ const i18n = {
'side-audit': 'Place Audit',
'side-docs': 'Documentation',
'side-upgrade': 'Upgrade Plan',
'side-beta': 'Beta Access',
'side-free-msg': "You're currently on the sandbox tier.",
// Dashboard General
'welcome': 'Welcome back',
// Header
'system-status': 'System Operational',
'quota-card-title': 'Monthly Quota',
'requests-left': 'requests left',
'used-label': 'USED',
'lang-toggle': 'العربية',
'loading': 'Loading...',
// KPI Labels
// Login
'login-title': 'Intaleq Maps',
'login-subtitle': 'The premium developer platform for mapping services in Jordan & Syria.',
'login-google': 'Continue with Google',
'login-footer': 'Enterprise Ready · Secure Access',
// Home / Dashboard
'welcome': 'Welcome back',
'tagline': 'Everything you need to build with premium Jordan Map Platform API',
'kpi-total-req': 'Total Requests',
'kpi-success-rate': 'Success Rate',
'kpi-active-keys': 'Active Keys',
'kpi-latency': 'Avg Latency',
'quota-card-title': 'Monthly Quota',
'req-left': 'requests left',
'live': 'Live',
'chart-request-volume': 'Request Traffic',
'chart-subtitle': 'Live traffic across all API endpoints',
'full-analytics': 'Full Analytics',
'quick-start': 'Quick Start',
'quick-start-msg': 'Get started with our lightweight SDK in seconds.',
'install-npm': '# Install with npm',
'view-api-ref': 'View API Reference',
'try-playground': 'Try Maps Playground',
// Keys Table
'keys-title': 'Your API Keys',
'keys-subtitle': 'Manage keys for your applications',
'keys-create': 'Create New Key',
'keys-fetching': 'Fetching your secure keys...',
'table-name': 'Name',
'table-key': 'API Key',
'table-status': 'Status',
'table-restrictions': 'Restrictions',
'table-actions': 'Actions',
'table-loc-name': 'Location Name',
'table-match': 'Automated Match',
'table-spatial': 'Spatial Context',
'table-date': 'Date',
'table-amount': 'Amount',
'table-provider': 'Provider',
// Playground
'playground-subtitle': 'Test your API keys and visualize vector tiles in real-time',
'pg-config': 'Configuration',
'pg-active-key': 'Active API Key',
'pg-style': 'Map Style',
'pg-search-placeholder': 'Search Amman, Jordan...',
// Analytics
'chart-request-volume': 'Request Volume (Overall)',
'chart-latency-breakdown': 'Latency Breakdown (ms)',
'analytics-subtitle': 'Deep insights into your API performance',
'chart-success-ratio': 'Success Ratio',
'chart-days': ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
'chart-latency-breakdown': 'Latency Breakdown',
// Audit
'audit-subtitle': 'Review and approve user-suggested map locations',
'audit-empty': 'No pending location suggestions.',
// Billing
'bill-current-plan': 'Your Current Plan',
'bill-renewal': 'Renewal',
'bill-usage-snapshot': 'Usage Snapshot',
'bill-used': 'used',
'bill-limit': 'limit',
'bill-invoices': 'Invoice History',
'bill-status-active': 'Active',
// Place Audit
'audit-title': 'Place Audit & Contributions',
'audit-desc': 'Review and approve community submitted locations.',
'audit-no-data': 'No pending contributions found.',
'billing-subtitle': 'Manage your plan, payment methods, and invoice history.',
'current-plan': 'Current Plan',
'billing-reset-msg': 'Your monthly usage resets on the 1st of each month.',
'active': 'Active',
'plan-sandbox': 'Sandbox',
'plan-starter-title': 'Starter',
'plan-pro-title': 'Professional',
'plan-ent-title': 'Enterprise',
'popular': 'Best Value',
'mo': 'mo',
'req-mo': 'requests /mo',
'req-min': 'requests / min',
'feature-tiles': 'Standard Map Tiles',
'feature-no-routing': 'No Routing API',
'feature-3d': '3D Building Data',
'feature-3d-ext': '3D Building Extrusion',
'feature-basic-geo': 'Basic Geocoding',
'feature-routing': 'Advanced Routing API',
'feature-priority': 'Priority Support',
'feature-custom': 'Custom Data Layers',
'feature-sla': 'SLA Guarantees',
'feature-dedicated': 'Dedicated Architect',
'plan-current': 'Current Plan',
'plan-upgrade-starter': 'Upgrade to Starter',
'pay-card': 'Pay with Card',
'contact-sales': 'Contact Sales',
'bill-transaction-history': 'Transaction History',
// Modals
'modal-key-title': 'Create API Key',
'modal-key-subtitle': 'Set up a new access point for your application.',
'modal-key-label': 'Key Name',
'cancel': 'Cancel',
'guides-title': 'Guides'
},
ar: {
// Navbar
// Navbar (Landing)
'nav-features': 'المميزات',
'nav-why': 'لماذا نحن؟',
'nav-pricing': 'الأسعار',
'nav-launch': 'لوحة التحكم',
'lang-toggle': 'English',
// Hero
// Hero (Landing)
'hero-badge': 'الآن مع المباني ثلاثية الأبعاد في الأردن وسوريا',
'hero-title': 'واجهة خرائط برمجية <br> <span class="text-blue-500">لا ترهق</span> ميزانيتك.',
'hero-desc': 'ابنِ تطبيقات خرائط فاخرة مع خرائط مجهزة، توجيه ذكي، ومباني ثلاثية الأبعاد. أوفر بنسبة 85% من خرائط جوجل.',
'hero-cta-start': 'ابدأ مجاناً',
'hero-cta-view': 'قارن الأسعار',
// Features
// Features (Landing)
'feat-latency-title': 'سرعة فائقة',
'feat-latency-desc': 'بنيتنا التحتية محسنة لمنطقة الشرق الأوسط، مما يضمن تحميل الخرائط في أقل من 200 مللي ثانية.',
'feat-routing-title': 'توجيه ذكي',
'feat-routing-desc': 'محرك توجيه من الفئة المؤسسية يدعم المسارات البديلة والوعي بحركة المرور.',
'feat-geocoding-title': 'بحث مكاني محلي',
'feat-geocoding-desc': 'دقة عالية جداً في البحث عن المعالم والأحياء في الأردن وسوريا.',
// Dashboard Sidebar
// Sidebar (Dashboard)
'side-dashboard': 'لوحة التحكم',
'side-playground': 'ساحة الاختبار',
'side-playground': 'المختبر',
'side-analytics': 'التحليلات',
'side-billing': 'الفواتير',
'side-audit': 'تدقيق الأماكن',
'side-docs': 'التوثيق',
'side-upgrade': 'ترقية الخطة',
'side-beta': 'وصول تجريبي',
'side-free-msg': 'أنت حالياً على الخطة المجانية.',
// Dashboard General
'welcome': 'مرحباً بك مجدداً',
// Header
'system-status': 'النظام يعمل بكفاءة',
'quota-card-title': 'رصيد الاستهلاك',
'requests-left': 'طلب متبقي',
'used-label': 'مستهلك',
'lang-toggle': 'English',
'loading': 'جاري التحميل...',
// KPI Labels
// Login
'login-title': 'انطلاق للخرائط',
'login-subtitle': 'منصة المطورين الأولى لخدمات الخرائط في الأردن وسوريا.',
'login-google': 'المتابعة باستخدام جوجل',
'login-footer': 'جاهز للمؤسسات · وصول آمن',
// Home / Dashboard
'welcome': 'مرحباً بك مجدداً',
'tagline': 'كل ما تحتاجه للبناء باستخدام واجهة خرائط الأردن المتطورة',
'kpi-total-req': 'إجمالي الطلبات',
'kpi-success-rate': 'نسبة النجاح',
'kpi-active-keys': 'المفاتيح النشطة',
'kpi-latency': 'متوسط سرعة الاستجابة',
'kpi-latency': 'متوسط الاستجابة',
'quota-card-title': 'الرصيد الشهري',
'req-left': 'طلب متبقي',
'live': 'مباشر',
'chart-request-volume': 'نشاط الطلبات',
'chart-subtitle': 'حركة البيانات المباشرة عبر جميع الواجهات',
'full-analytics': 'التحليلات الكاملة',
'quick-start': 'البداية السريعة',
'quick-start-msg': 'ابدأ الدمج باستخدام مكتبتنا البرمجية في ثوانٍ.',
'install-npm': '# التثبيت عبر npm',
'view-api-ref': 'عرض مرجع الـ API',
'try-playground': 'تجربة المختبر',
// Keys Table
'keys-title': 'مفاتيح الـ API الخاصة بك',
'keys-subtitle': 'إدارة مفاتيح الوصول لتطبيقاتك',
'keys-create': 'إنشاء مفتاح جديد',
'keys-fetching': 'جاري جلب مفاتيحك الآمنة...',
'table-name': 'الاسم',
'table-key': 'مفتاح الـ API',
'table-status': 'الحالة',
'table-restrictions': 'القيود',
'table-actions': 'الإجراءات',
'table-loc-name': 'اسم الموقع',
'table-match': 'المطابقة التلقائية',
'table-spatial': 'السياق المكاني',
'table-date': 'التاريخ',
'table-amount': 'المبلغ',
'table-provider': 'المزود',
// Playground
'playground-subtitle': 'اختبر مفاتيحك وعاين خرائط الـ Vector في الوقت الفعلي',
'pg-config': 'الإعدادات',
'pg-active-key': 'مفتاح الـ API النشط',
'pg-style': 'تنسيق الخريطة',
'pg-search-placeholder': 'ابحث في عمان، الأردن...',
// Analytics
'chart-request-volume': 'حجم الطلبات الكلية',
'chart-latency-breakdown': 'تحليل سرعة الاستجابة (مللي ثانية)',
'chart-success-ratio': 'نسبة نجاح الطلبات',
'chart-days': ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
'analytics-subtitle': 'رؤى عميقة حول أداء واجهات البرمجة الخاصة بك',
'chart-success-ratio': 'نسبة النجاح',
'chart-latency-breakdown': 'تفاصيل وقت الاستجابة',
// Audit
'audit-subtitle': 'مراجعة واعتماد المواقع المقترحة من المستخدمين',
'audit-empty': 'لا توجد مقترحات مواقع معلقة حالياً.',
// Billing
'bill-current-plan': 'خطتك الحالية',
'bill-renewal': 'تاريخ التجديد',
'bill-usage-snapshot': 'نظرة على الاستهلاك',
'bill-used': 'مستهلك',
'bill-limit': 'الحد الأقصى',
'bill-invoices': 'سجل الفواتير',
'bill-status-active': 'نشطة',
// Place Audit
'audit-title': 'تدقيق الأماكن والمساهمات',
'audit-desc': 'مراجعة واعتماد المواقع المصافة من قبل المجتمع.',
'audit-no-data': 'لا توجد مساهمات معلقة حالياً.',
'billing-subtitle': 'إدارة خطتك، وسائل الدفع، وسجل الفواتير.',
'current-plan': 'الخطة الحالية',
'billing-reset-msg': 'يتم إعادة تعيين رصيدك في اليوم الأول من كل شهر.',
'active': 'نشط',
'plan-sandbox': 'تجريبية',
'plan-starter-title': 'مبتدئ',
'plan-pro-title': 'احترافي',
'plan-ent-title': 'مؤسسات',
'popular': 'الأكثر قيمة',
'mo': 'شهر',
'req-mo': 'طلب / شهر',
'req-min': 'طلب / دقيقة',
'feature-tiles': 'خرائط Vector القياسية',
'feature-no-routing': 'بدون خدمة المسارات',
'feature-3d': 'بيانات المباني ثلاثية الأبعاد',
'feature-3d-ext': 'مباني ثلاثية الأبعاد (Extrusion)',
'feature-basic-geo': 'تكويد جغرافي أساسي',
'feature-routing': 'واجهة مسارات متطورة',
'feature-priority': 'دعم فني ذو أولوية',
'feature-custom': 'طبقات بيانات مخصصة',
'feature-sla': 'ضمانات مستوى الخدمة',
'feature-dedicated': 'مهندس دعم مخصص',
'plan-current': 'الخطة الحالية',
'plan-upgrade-starter': 'ترقية إلى "مبتدئ"',
'pay-card': 'الدفع بالبطاقة',
'contact-sales': 'تواصل مع المبيعات',
'bill-transaction-history': 'سجل العمليات',
// Modals
'modal-key-title': 'إنشاء مفتاح API',
'modal-key-subtitle': 'إعداد نقطة وصول جديدة لتطبيقك.',
'modal-key-label': 'اسم المفتاح',
'cancel': 'إلغاء',
'guides-title': 'الأدلة برمجية'
}
},
init: () => {
console.log(`🌍 i18n Initializing: ${i18n.currentLang}`);
i18n.apply(i18n.currentLang);
},
toggle: () => {
const nextLang = i18n.currentLang === 'en' ? 'ar' : 'en';
i18n.currentLang = nextLang;
localStorage.setItem('intaleq_lang', nextLang);
i18n.apply(nextLang);
i18n.currentLang = i18n.currentLang === 'en' ? 'ar' : 'en';
localStorage.setItem('intaleq_lang', i18n.currentLang);
location.reload();
},
apply: (lang) => {
@@ -154,7 +290,7 @@ const i18n = {
document.documentElement.dir = rtl ? 'rtl' : 'ltr';
document.documentElement.lang = lang;
// Apply font classes
// Apply font families
if (rtl) {
document.body.style.fontFamily = "'Cairo', sans-serif";
document.body.classList.add('rtl-mode');
@@ -163,7 +299,7 @@ const i18n = {
document.body.classList.remove('rtl-mode');
}
// Mirror Sidebar if in dashboard
// Sidebar mirroring logic
const sidebar = document.getElementById('main-sidebar');
if (sidebar) {
if (rtl) {
@@ -175,7 +311,7 @@ const i18n = {
}
}
// Translate elements with data-i18n attribute
// Apply text content
document.querySelectorAll('[data-i18n]').forEach(el => {
const key = el.getAttribute('data-i18n');
const translation = i18n.translations[lang][key];
@@ -188,10 +324,17 @@ const i18n = {
}
});
// Trigger icon re-render if lucide is present
// Apply placeholders
document.querySelectorAll('[data-i18n-placeholder]').forEach(el => {
const key = el.getAttribute('data-i18n-placeholder');
const translation = i18n.translations[lang][key];
if (translation) el.placeholder = translation;
});
// Trigger icon re-render
if (window.lucide) lucide.createIcons();
}
};
// Initialize on load
// Auto-init
document.addEventListener('DOMContentLoaded', i18n.init);