from pathlib import Path
root=Path('/home/ubuntu/clinic-management')
vals={
'en':{
'doctors':'Doctors','no_users':'No registered users','unspecified':'Not specified','appointment_short':'Appointment','book_visit':'Book visit','cancelled_visits':'Cancelled visits','catalog':'Catalog','clinic_dashboard_title':'Clinic dashboard','clinic_data':'Clinic data','companies_and_plans':'Companies and plans','completed_visits':'Completed visits','create_new_record':'Create new record','current_reception_schedule':'Current reception schedule','daily_operations_summary':'Daily operations summary','dashboard_intro':'Manage your clinic operations, patients, appointments and revenue from one place.','financial_catalog_items':'Financial catalog items','financial_report':'Financial report','from_month_start':'From the beginning of the month','income':'Income','inventory_items_count':'Inventory items','items_under_review':'Items under review','linked_clinic_records':'Linked clinic records','new_patient_short':'New patient','open_patient_records':'Open patient records','payments_recorded_today':'Payments recorded today','quick_actions':'Quick actions','rescheduled_visits':'Rescheduled visits','services_and_procedures':'Services and procedures','services_procedures':'Services and procedures','start_here':'Start here','stock_items_quantities':'Stock items and quantities','this_month':'This month','today':'Today','today_appointments':'Today appointments','total':'Total','total_patients':'Total patients','view_today_appointments':'View today appointments','visit_status':'Visit status','welcome_to_clinic':'Welcome to your clinic'},
'ar':{
'doctors':'الأطباء','no_users':'لا يوجد مستخدمون مسجلون','unspecified':'غير محدد','appointment_short':'موعد','book_visit':'حجز موعد','cancelled_visits':'الزيارات الملغاة','catalog':'الكتالوج','clinic_dashboard_title':'لوحة تحكم العيادة','clinic_data':'بيانات العيادة','companies_and_plans':'الشركات والشرائح','completed_visits':'الزيارات المكتملة','create_new_record':'إنشاء ملف جديد','current_reception_schedule':'جدول الاستقبال الحالي','daily_operations_summary':'ملخص التشغيل اليومي','dashboard_intro':'أدر عمليات العيادة والمرضى والمواعيد والإيرادات من مكان واحد.','financial_catalog_items':'عناصر الكتالوج المالي','financial_report':'التقرير المالي','from_month_start':'من بداية الشهر','income':'الإيرادات','inventory_items_count':'أصناف المخزون','items_under_review':'أصناف قيد المراجعة','linked_clinic_records':'سجلات العيادة المرتبطة','new_patient_short':'مريض جديد','open_patient_records':'فتح ملفات المرضى','payments_recorded_today':'المدفوعات المسجلة اليوم','quick_actions':'إجراءات سريعة','rescheduled_visits':'الزيارات المؤجلة','services_and_procedures':'الخدمات والإجراءات','services_procedures':'الخدمات والإجراءات','start_here':'ابدأ من هنا','stock_items_quantities':'أصناف وكميات المخزون','this_month':'هذا الشهر','today':'اليوم','today_appointments':'مواعيد اليوم','total':'الإجمالي','total_patients':'إجمالي المرضى','view_today_appointments':'عرض مواعيد اليوم','visit_status':'حالة الزيارات','welcome_to_clinic':'مرحباً بك في عيادتك'}
}
for loc, data in vals.items():
 p=root/f'lang/{loc}/ui.php'; s=p.read_text(); add=''
 for k,v in data.items():
  if f"'{k}' =>" not in s:
   add += f"    '{k}' => '{v.replace(chr(39), chr(92)+chr(39))}',\n"
 if add: s=s.replace('\n];','\n'+add+'];',1)
 p.write_text(s)
print('dashboard keys added')
