Update PDF export to use localized filenames and remove extra text
Modify the API server and frontend to generate dynamic, localized PDF filenames for executive meetings, and remove descriptive text from the PDF export page. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 6e1661b8-f4ab-45e7-a6c8-93293ffc7c62 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/EWwamzQ Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -2749,10 +2749,12 @@ router.get(
|
||||
console.error("[executive-meetings] PDF archive insert failed", err);
|
||||
}
|
||||
|
||||
const dayName = new Intl.DateTimeFormat(langRaw === "ar" ? "ar-SA" : "en-US", { weekday: "long" }).format(new Date(dateRaw + "T00:00:00"));
|
||||
const pdfFileName = langRaw === "ar" ? `قائمة الاجتماعات يوم ${dayName}.pdf` : `meetings-${dayName}.pdf`;
|
||||
res.setHeader("Content-Type", "application/pdf");
|
||||
res.setHeader(
|
||||
"Content-Disposition",
|
||||
`attachment; filename="executive-meetings-${dateRaw}.pdf"`,
|
||||
`attachment; filename="${encodeURIComponent(pdfFileName)}"; filename*=UTF-8''${encodeURIComponent(pdfFileName)}`,
|
||||
);
|
||||
res.setHeader("Content-Length", String(pdf.byteLength));
|
||||
res.setHeader("Cache-Control", "no-store");
|
||||
|
||||
@@ -1400,9 +1400,9 @@
|
||||
},
|
||||
"pdf": {
|
||||
"heading": "تصدير PDF",
|
||||
"intro": "يتم توليد ملف PDF حقيقي لجدول اليوم على الخادم باستخدام إعدادات الخط المحفوظة. كل عملية تنزيل تتم أرشفتها.",
|
||||
"intro": "",
|
||||
"downloadPdf": "تنزيل PDF",
|
||||
"downloadHint": "يُولَّد ملف PDF حسب تفضيلات الخط (النوع، الحجم، الوزن، المحاذاة) مع تشكيل عربي صحيح من اليمين لليسار.",
|
||||
"downloadHint": "",
|
||||
"downloaded": "بدأ تنزيل ملف PDF",
|
||||
"selectDate": "تاريخ الجدول",
|
||||
"archivesHeading": "ملفات PDF المؤرشفة",
|
||||
|
||||
@@ -1266,9 +1266,9 @@
|
||||
},
|
||||
"pdf": {
|
||||
"heading": "PDF Export",
|
||||
"intro": "Generates a real PDF of the day's schedule on the server using your saved font settings. Each download is archived.",
|
||||
"intro": "",
|
||||
"downloadPdf": "Download PDF",
|
||||
"downloadHint": "The PDF is generated using your font preferences (family, size, weight, alignment) with proper Arabic shaping.",
|
||||
"downloadHint": "",
|
||||
"downloaded": "PDF download started",
|
||||
"selectDate": "Schedule date",
|
||||
"archivesHeading": "Archived PDFs",
|
||||
|
||||
@@ -7095,7 +7095,9 @@ function PdfSection({
|
||||
const url = `/api/executive-meetings/pdf?date=${encodeURIComponent(
|
||||
date,
|
||||
)}&lang=${encodeURIComponent(lang)}`;
|
||||
await downloadBinary(url, `executive-meetings-${date}.pdf`);
|
||||
const dayName = new Intl.DateTimeFormat(lang === "ar" ? "ar-SA" : "en-US", { weekday: "long" }).format(new Date(date + "T00:00:00"));
|
||||
const fileName = lang === "ar" ? `قائمة الاجتماعات يوم ${dayName}.pdf` : `meetings-${dayName}.pdf`;
|
||||
await downloadBinary(url, fileName);
|
||||
// Refresh archives so the row created by the GET appears.
|
||||
await qc.invalidateQueries({
|
||||
queryKey: ["/api/executive-meetings/pdf-archives", date],
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
Reference in New Issue
Block a user