From 60cc9db469e7ef43b4cf561a84f9cc0841d6fa77 Mon Sep 17 00:00:00 2001 From: Ahmed Darrazi Date: Thu, 18 Dec 2025 22:57:40 +0100 Subject: [PATCH] some bugfixes --- .../js/components/certificate-generator.tsx | 68 +++++++++---------- .../course-player/partials/content-list.tsx | 10 +-- .../pages/courses/partials/course-preview.tsx | 2 +- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/resources/js/components/certificate-generator.tsx b/resources/js/components/certificate-generator.tsx index b14ba79e..2bbd99e4 100644 --- a/resources/js/components/certificate-generator.tsx +++ b/resources/js/components/certificate-generator.tsx @@ -20,7 +20,7 @@ const CertificateGenerator = () => { const handleGenerateCertificate = async () => { if (!studentName || !courseName || !completionDate) { - toast.error('Please fill in all required fields.'); + toast.error('Bitte fülle alle Pflichtfelder aus.'); return; } @@ -28,8 +28,8 @@ const CertificateGenerator = () => { // Simulate certificate generation setTimeout(() => { - setIsGenerating(false); - toast.success('Your course completion certificate has been created successfully.'); + setIsGenerating(false); + toast.success('Dein Kursabschlusszertifikat wurde erfolgreich erstellt.'); }, 2000); }; @@ -73,7 +73,7 @@ const CertificateGenerator = () => { document.body.removeChild(a); URL.revokeObjectURL(url); - toast.success('Your PNG certificate has been saved to your downloads folder.'); + toast.success('Dein PNG-Zertifikat wurde in deinem Download-Ordner gespeichert.'); }, 'image/png'); }; @@ -107,7 +107,7 @@ const CertificateGenerator = () => { // Save the PDF pdf.save(`${studentName}_${courseName}_Certificate.pdf`); - toast.success('Your PDF certificate has been saved to your downloads folder.'); + toast.success('Dein PDF-Zertifikat wurde in deinem Download-Ordner gespeichert.'); }; const drawCertificate = (ctx: CanvasRenderingContext2D, dimensions: { width: number; height: number }) => { @@ -135,7 +135,7 @@ const CertificateGenerator = () => { // Title ctx.font = 'bold 42px serif'; - ctx.fillText('Certificate of Completion', dimensions.width / 2, 120); + ctx.fillText('Abschlusszertifikat', dimensions.width / 2, 120); // Decorative line under title ctx.strokeStyle = '#f59e0b'; @@ -148,7 +148,7 @@ const CertificateGenerator = () => { // "This is to certify that" ctx.font = '22px serif'; ctx.fillStyle = '#4b5563'; - ctx.fillText('This is to certify that', dimensions.width / 2, 190); + ctx.fillText('Hiermit wird bescheinigt, dass', dimensions.width / 2, 190); // Student name with underline ctx.font = 'bold 36px serif'; @@ -167,7 +167,7 @@ const CertificateGenerator = () => { // "has successfully completed the course" ctx.font = '22px serif'; ctx.fillStyle = '#4b5563'; - ctx.fillText('has successfully completed the course', dimensions.width / 2, 320); + ctx.fillText('den Kurs erfolgreich abgeschlossen hat', dimensions.width / 2, 320); // Course name ctx.font = 'bold 28px serif'; @@ -177,7 +177,7 @@ const CertificateGenerator = () => { // Completion date ctx.font = '18px serif'; ctx.fillStyle = '#6b7280'; - ctx.fillText(`Completed on: ${completionDate}`, dimensions.width / 2, 430); + ctx.fillText(`Abgeschlossen am: ${completionDate}`, dimensions.width / 2, 430); // Footer ctx.font = '16px serif'; @@ -190,9 +190,9 @@ const CertificateGenerator = () => { return (
-

Course Certificate Generator

-

Generate your official course completion certificate

-
+

Zertifikatsgenerator

+

Erstelle dein offizielles Kursabschlusszertifikat

+
{/* Form Section */} @@ -200,23 +200,23 @@ const CertificateGenerator = () => { - Certificate Details + Zertifikatsdetails
- + setStudentName(e.target.value)} - placeholder="Enter your full name" + placeholder="Gib deinen vollständigen Namen ein" />
- - setCourseName(e.target.value)} placeholder="Enter the course name" /> + + setCourseName(e.target.value)} placeholder="Gib den Kursnamen ein" />
@@ -232,33 +232,33 @@ const CertificateGenerator = () => {
- +
- +
@@ -269,12 +269,12 @@ const CertificateGenerator = () => { {isGenerating ? ( <>
- Generating Certificate... + Zertifikat wird erstellt... ) : ( <> - Generate Certificate + Zertifikat erstellen )} @@ -284,7 +284,7 @@ const CertificateGenerator = () => { {/* Preview Section */} - Certificate Preview + Zertifikatsvorschau
{
-

Certificate of Completion

+

Abschlusszertifikat

-

This is to certify that

+

Hiermit wird bescheinigt, dass

{studentName || 'Student Name'}

-

has successfully completed the course

-

{courseName || 'Course Name'}

+

den Kurs erfolgreich abgeschlossen hat

+

{courseName || 'Kursname'}

-

Completed on: {completionDate || 'Date'}

+

Abgeschlossen am: {completionDate || 'Datum'}

-

Authorized Certificate of Achievement

+

Autorisierte Leistungsurkunde

@@ -324,7 +324,7 @@ const CertificateGenerator = () => { {studentName && courseName && completionDate && ( )}
diff --git a/resources/js/pages/course-player/partials/content-list.tsx b/resources/js/pages/course-player/partials/content-list.tsx index d76e0086..b8742d0c 100644 --- a/resources/js/pages/course-player/partials/content-list.tsx +++ b/resources/js/pages/course-player/partials/content-list.tsx @@ -28,7 +28,7 @@ interface ContentListProps { const ContentList = ({ completedContents, courseCompletion }: ContentListProps) => { const { props } = usePage(); const { course, zoomConfig, section, watchHistory, translate, direction } = props; - const { button, common } = translate; + const { button, common, frontend } = translate; // Get live classes from course data const liveClasses = course.live_classes || []; @@ -119,7 +119,7 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps) })} >
@@ -127,11 +127,11 @@ const ContentList = ({ completedContents, courseCompletion }: ContentListProps)
{!watchHistory.next_watching_id ? ( ) : ( - )}
diff --git a/resources/js/pages/courses/partials/course-preview.tsx b/resources/js/pages/courses/partials/course-preview.tsx index 9bb7f30f..563acb34 100644 --- a/resources/js/pages/courses/partials/course-preview.tsx +++ b/resources/js/pages/courses/partials/course-preview.tsx @@ -117,7 +117,7 @@ const CoursePreview = () => { {frontend.certificate_included} - Yes + {course.certificate_included ? 'Ja' : 'Nein'}