🌐 dashboard i18n (TR/EN) and agent approval scope in AGENTS.md
Browse files at this commitc4b3ac8acee855282f212cb285b51b10b86867b9Parent: 1f9dcb1- feat
- 🌐 dashboard i18n (TR/EN) and agent approval scope in AGENTS.md
2 changed files +124 -114
- AGENTS.md +6 -0
- src/pages/dashboard-page.tsx +118 -114
AGENTS.mdmodified+6 -0
| @@ -7,6 +7,12 @@ Keep this file lightweight — hard constraints and repo gotchas only. Detailed | |||
| 7 | procedures live as loadable references (see **On-demand references** below); open | 7 | procedures live as loadable references (see **On-demand references** below); open |
| 8 | the relevant one when a task touches that area instead of inlining it here. | 8 | the relevant one when a task touches that area instead of inlining it here. |
| 9 | 9 | ||
| 10 | +## Approval scope | ||
| 11 | + | ||
| 12 | +User pre-approves workspace edits and verification commands (`bun run build`, | ||
| 13 | +`tsc --noEmit`, `vite build`, test runs, lint) — run them without asking. The | ||
| 14 | +only mandatory approval gate is at commit time: see **commit-workflow**. | ||
| 15 | + | ||
| 10 | ## Stack (hard constraints) | 16 | ## Stack (hard constraints) |
| 11 | 17 | ||
| 12 | - SolidJS + TypeScript, Vite scaffold. | 18 | - SolidJS + TypeScript, Vite scaffold. |
src/pages/dashboard-page.tsxmodified+118 -114
| @@ -178,6 +178,9 @@ function DashboardContent() { | |||
| 178 | const auth = useAuth(); | 178 | const auth = useAuth(); |
| 179 | const t = useT(); | 179 | const t = useT(); |
| 180 | const { locale } = usePreferences(); | 180 | const { locale } = usePreferences(); |
| 181 | + const copy = (tr: string, en: string) => (locale() === "tr" ? tr : en); | ||
| 182 | + const countLabel = (count: number, tr: string, en: string) => `${count} ${copy(tr, en)}`; | ||
| 183 | + const percentLabel = (value: number) => (locale() === "tr" ? `%${value}` : `${value}%`); | ||
| 181 | const user = () => auth.user()!; | 184 | const user = () => auth.user()!; |
| 182 | const role = () => user().role; | 185 | const role = () => user().role; |
| 183 | const now = createNow(); | 186 | const now = createNow(); |
| @@ -523,9 +526,9 @@ function DashboardContent() { | |||
| 523 | const todayCount = items.filter((i) => i.status === "today").length; | 526 | const todayCount = items.filter((i) => i.status === "today").length; |
| 524 | const soonCount = items.filter((i) => i.status === "soon").length; | 527 | const soonCount = items.filter((i) => i.status === "soon").length; |
| 525 | return [ | 528 | return [ |
| 526 | - { id: "active", label: "Aktif Program", value: activeCount, colorClass: "bg-emerald-500" }, | 529 | + { id: "active", label: copy("Aktif Program", "Active schedule"), value: activeCount, colorClass: "bg-emerald-500" }, |
| 527 | - { id: "today", label: "Bugünkü Sınav / Etkinlik", value: todayCount, colorClass: "bg-amber-500" }, | 530 | + { id: "today", label: copy("Bugünkü Sınav / Etkinlik", "Today exams / events"), value: todayCount, colorClass: "bg-amber-500" }, |
| 528 | - { id: "soon", label: "Yakında (7 Gün İçi)", value: soonCount, colorClass: "bg-indigo-500" }, | 531 | + { id: "soon", label: copy("Yakında (7 Gün İçi)", "Next 7 days"), value: soonCount, colorClass: "bg-indigo-500" }, |
| 529 | ]; | 532 | ]; |
| 530 | }); | 533 | }); |
| 531 | 534 | ||
| @@ -535,23 +538,23 @@ function DashboardContent() { | |||
| 535 | const today = items.filter((i) => i.status === "today").length; | 538 | const today = items.filter((i) => i.status === "today").length; |
| 536 | const soon = items.filter((i) => i.status === "soon").length; | 539 | const soon = items.filter((i) => i.status === "soon").length; |
| 537 | return [ | 540 | return [ |
| 538 | - { id: "active", label: "Aktif", value: active, colorClass: "bg-emerald-500" }, | 541 | + { id: "active", label: copy("Aktif", "Active"), value: active, colorClass: "bg-emerald-500" }, |
| 539 | - { id: "today", label: "Bugün", value: today, colorClass: "bg-amber-500" }, | 542 | + { id: "today", label: copy("Bugün", "Today"), value: today, colorClass: "bg-amber-500" }, |
| 540 | - { id: "soon", label: "Yakında", value: soon, colorClass: "bg-indigo-500" }, | 543 | + { id: "soon", label: copy("Yakında", "Upcoming"), value: soon, colorClass: "bg-indigo-500" }, |
| 541 | ]; | 544 | ]; |
| 542 | }); | 545 | }); |
| 543 | 546 | ||
| 544 | const weeklyDensityItems = createMemo<ChartBarItem[]>(() => { | 547 | const weeklyDensityItems = createMemo<ChartBarItem[]>(() => { |
| 545 | const days: { id: string; label: string; count: number }[] = []; | 548 | const days: { id: string; label: string; count: number }[] = []; |
| 546 | const today = new Date(); | 549 | const today = new Date(); |
| 547 | - const dayNames = ["Pzr", "Pzt", "Sal", "Çrş", "Prş", "Cum", "Cmt"]; | 550 | + const dayNames = locale() === "tr" ? ["Pzr", "Pzt", "Sal", "Çrş", "Prş", "Cum", "Cmt"] : ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; |
| 548 | 551 | ||
| 549 | for (let i = 0; i < 7; i++) { | 552 | for (let i = 0; i < 7; i++) { |
| 550 | const d = new Date(today); | 553 | const d = new Date(today); |
| 551 | d.setDate(today.getDate() + i); | 554 | d.setDate(today.getDate() + i); |
| 552 | const dayStart = new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime(); | 555 | const dayStart = new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime(); |
| 553 | const dayEnd = dayStart + 86400000; | 556 | const dayEnd = dayStart + 86400000; |
| 554 | - const dayLabel = i === 0 ? "Bugün" : `${dayNames[d.getDay()]} ${d.getDate()}`; | 557 | + const dayLabel = i === 0 ? copy("Bugün", "Today") : `${dayNames[d.getDay()]} ${d.getDate()}`; |
| 555 | 558 | ||
| 556 | let count = 0; | 559 | let count = 0; |
| 557 | for (const exam of visibleExams()) { | 560 | for (const exam of visibleExams()) { |
| @@ -580,7 +583,7 @@ function DashboardContent() { | |||
| 580 | id: d.id, | 583 | id: d.id, |
| 581 | label: d.label, | 584 | label: d.label, |
| 582 | value: d.count, | 585 | value: d.count, |
| 583 | - formattedValue: `${d.count} Aktivite`, | 586 | + formattedValue: `${d.count} ${copy("Aktivite", "activities")}`, |
| 584 | colorClass: d.count > 0 ? "bg-emerald-500" : "bg-muted-foreground/30", | 587 | colorClass: d.count > 0 ? "bg-emerald-500" : "bg-muted-foreground/30", |
| 585 | })); | 588 | })); |
| 586 | }); | 589 | }); |
| @@ -609,14 +612,14 @@ function DashboardContent() { | |||
| 609 | return courseWithAvg.map((c) => ({ | 612 | return courseWithAvg.map((c) => ({ |
| 610 | label: c.course.title, | 613 | label: c.course.title, |
| 611 | value: c.average!, | 614 | value: c.average!, |
| 612 | - formattedValue: `${Math.round(c.average! * 10) / 10} Puan`, | 615 | + formattedValue: `${Math.round(c.average! * 10) / 10} ${copy("Puan", "points")}`, |
| 613 | })); | 616 | })); |
| 614 | } | 617 | } |
| 615 | 618 | ||
| 616 | return entries.slice(-6).map((e) => ({ | 619 | return entries.slice(-6).map((e) => ({ |
| 617 | label: e.label, | 620 | label: e.label, |
| 618 | value: e.value, | 621 | value: e.value, |
| 619 | - formattedValue: `${Math.round(e.value * 10) / 10} Puan`, | 622 | + formattedValue: `${Math.round(e.value * 10) / 10} ${copy("Puan", "points")}`, |
| 620 | })); | 623 | })); |
| 621 | }); | 624 | }); |
| 622 | 625 | ||
| @@ -626,31 +629,31 @@ function DashboardContent() { | |||
| 626 | return [ | 629 | return [ |
| 627 | { | 630 | { |
| 628 | id: "gpa", | 631 | id: "gpa", |
| 629 | - label: "Not Ortalaması", | 632 | + label: copy("Not Ortalaması", "Average grade"), |
| 630 | - value: avgLabel() === "—" ? "Kayıt yok" : avgLabel(), | 633 | + value: avgLabel() === "—" ? copy("Kayıt yok", "No records") : avgLabel(), |
| 631 | - change: avg != null ? (avg >= 70 ? "Yüksek" : "Normal") : undefined, | 634 | + change: avg != null ? (avg >= 70 ? copy("Yüksek", "High") : copy("Normal", "Normal")) : undefined, |
| 632 | isPositive: avg != null ? avg >= 50 : true, | 635 | isPositive: avg != null ? avg >= 50 : true, |
| 633 | - subtext: "Genel ders başarı ortalaması", | 636 | + subtext: copy("Genel ders başarı ortalaması", "Overall course average"), |
| 634 | }, | 637 | }, |
| 635 | { | 638 | { |
| 636 | id: "attendance", | 639 | id: "attendance", |
| 637 | - label: "Derse Katılım", | 640 | + label: copy("Derse Katılım", "Attendance"), |
| 638 | - value: att != null ? `%${att}` : "Kayıt yok", | 641 | + value: att != null ? percentLabel(att) : copy("Kayıt yok", "No records"), |
| 639 | - change: att != null ? (att >= 85 ? "Düzenli" : "Takip Edilmeli") : undefined, | 642 | + change: att != null ? (att >= 85 ? copy("Düzenli", "Regular") : copy("Takip Edilmeli", "Needs attention")) : undefined, |
| 640 | isPositive: att != null ? att >= 85 : true, | 643 | isPositive: att != null ? att >= 85 : true, |
| 641 | - subtext: "Devamlılık oranı", | 644 | + subtext: copy("Devamlılık oranı", "Attendance rate"), |
| 642 | }, | 645 | }, |
| 643 | { | 646 | { |
| 644 | id: "notes", | 647 | id: "notes", |
| 645 | - label: "Ders Notları", | 648 | + label: copy("Ders Notları", "Course notes"), |
| 646 | - value: noteCount() > 0 ? `${noteCount()} Not` : "Kayıt yok", | 649 | + value: noteCount() > 0 ? countLabel(noteCount(), "Not", "notes") : copy("Kayıt yok", "No records"), |
| 647 | - subtext: "Kayıtlı notlar", | 650 | + subtext: copy("Kayıtlı notlar", "Saved notes"), |
| 648 | }, | 651 | }, |
| 649 | { | 652 | { |
| 650 | id: "courses", | 653 | id: "courses", |
| 651 | - label: "Kayıtlı Dersler", | 654 | + label: copy("Kayıtlı Dersler", "Enrolled courses"), |
| 652 | - value: scopedCourses().length > 0 ? `${scopedCourses().length} Ders` : "Kayıt yok", | 655 | + value: scopedCourses().length > 0 ? countLabel(scopedCourses().length, "Ders", "courses") : copy("Kayıt yok", "No records"), |
| 653 | - subtext: "Aktif müfredat programı", | 656 | + subtext: copy("Aktif müfredat programı", "Active curriculum"), |
| 654 | }, | 657 | }, |
| 655 | ]; | 658 | ]; |
| 656 | }); | 659 | }); |
| @@ -658,34 +661,34 @@ function DashboardContent() { | |||
| 658 | const teacherMetricCards = createMemo<ChartMetricCardItem[]>(() => { | 661 | const teacherMetricCards = createMemo<ChartMetricCardItem[]>(() => { |
| 659 | const att = realAttendanceRate(); | 662 | const att = realAttendanceRate(); |
| 660 | return [ | 663 | return [ |
| 661 | - { id: "avgMark", label: "Sınıf Not Ortalaması", value: "78.4", change: "+1.5%", isPositive: true, subtext: "Sorumlu sınıflar" }, | 664 | + { id: "avgMark", label: copy("Sınıf Not Ortalaması", "Class average"), value: "78.4", change: "+1.5%", isPositive: true, subtext: copy("Sorumlu sınıflar", "Assigned classes") }, |
| 662 | { | 665 | { |
| 663 | id: "attRate", | 666 | id: "attRate", |
| 664 | - label: "Sınıf Katılım Oranı", | 667 | + label: copy("Sınıf Katılım Oranı", "Class attendance rate"), |
| 665 | - value: att != null ? `%${att}` : "Kayıt yok", | 668 | + value: att != null ? percentLabel(att) : copy("Kayıt yok", "No records"), |
| 666 | - change: att != null ? (att >= 85 ? "Yüksek" : "Takip Edilmeli") : undefined, | 669 | + change: att != null ? (att >= 85 ? copy("Yüksek", "High") : copy("Takip Edilmeli", "Needs attention")) : undefined, |
| 667 | isPositive: att != null ? att >= 85 : true, | 670 | isPositive: att != null ? att >= 85 : true, |
| 668 | - subtext: "Ortalama devam", | 671 | + subtext: copy("Ortalama devam", "Average attendance"), |
| 669 | }, | 672 | }, |
| 670 | - { id: "activeExams", label: "Sınav Sayısı", value: `${examCount()} Sınav`, subtext: "Okunan ve canlı" }, | 673 | + { id: "activeExams", label: copy("Sınav Sayısı", "Exam count"), value: countLabel(examCount(), "Sınav", "exams"), subtext: copy("Okunan ve canlı", "Graded and live") }, |
| 671 | - { id: "myCourses", label: "Verilen Dersler", value: `${scopedCourses().length} Ders`, subtext: "Aktif ders yükü" }, | 674 | + { id: "myCourses", label: copy("Verilen Dersler", "Assigned courses"), value: countLabel(scopedCourses().length, "Ders", "courses"), subtext: copy("Aktif ders yükü", "Active teaching load") }, |
| 672 | ]; | 675 | ]; |
| 673 | }); | 676 | }); |
| 674 | 677 | ||
| 675 | const managerMetricCards = createMemo<ChartMetricCardItem[]>(() => { | 678 | const managerMetricCards = createMemo<ChartMetricCardItem[]>(() => { |
| 676 | const att = realAttendanceRate(); | 679 | const att = realAttendanceRate(); |
| 677 | return [ | 680 | return [ |
| 678 | - { id: "schoolAvg", label: "Okul Başarı Ortalaması", value: "81.2", change: "+2.4%", isPositive: true, subtext: "Kurum ortalaması" }, | 681 | + { id: "schoolAvg", label: copy("Okul Başarı Ortalaması", "School average"), value: "81.2", change: "+2.4%", isPositive: true, subtext: copy("Kurum ortalaması", "Institution average") }, |
| 679 | { | 682 | { |
| 680 | id: "overallAtt", | 683 | id: "overallAtt", |
| 681 | - label: "Genel Devamlılık", | 684 | + label: copy("Genel Devamlılık", "Overall attendance"), |
| 682 | - value: att != null ? `%${att}` : "Kayıt yok", | 685 | + value: att != null ? percentLabel(att) : copy("Kayıt yok", "No records"), |
| 683 | - change: att != null ? (att >= 85 ? "Yüksek" : "Takip Edilmeli") : undefined, | 686 | + change: att != null ? (att >= 85 ? copy("Yüksek", "High") : copy("Takip Edilmeli", "Needs attention")) : undefined, |
| 684 | isPositive: att != null ? att >= 85 : true, | 687 | isPositive: att != null ? att >= 85 : true, |
| 685 | - subtext: "Tüm sınıflar", | 688 | + subtext: copy("Tüm sınıflar", "All classes"), |
| 686 | }, | 689 | }, |
| 687 | - { id: "staffWork", label: "Personel Mesai", value: "88.0%", subtext: "Tamamlanan vardiya" }, | 690 | + { id: "staffWork", label: copy("Personel Mesai", "Staff work"), value: "88.0%", subtext: copy("Tamamlanan vardiya", "Completed shifts") }, |
| 688 | - { id: "totalPrograms", label: "Program Sayısı", value: `${courseCount() + studyCount() + clubCount()} Program`, subtext: "Ders, etüt, kulüp" }, | 691 | + { id: "totalPrograms", label: copy("Program Sayısı", "Program count"), value: countLabel(courseCount() + studyCount() + clubCount(), "Program", "programs"), subtext: copy("Ders, etüt, kulüp", "Courses, studies, clubs") }, |
| 689 | ]; | 692 | ]; |
| 690 | }); | 693 | }); |
| 691 | 694 | ||
| @@ -712,36 +715,36 @@ function DashboardContent() { | |||
| 712 | const total = visibleExams().length; | 715 | const total = visibleExams().length; |
| 713 | const active = visibleExams().filter((e) => examWindow(e, now()) === "active").length; | 716 | const active = visibleExams().filter((e) => examWindow(e, now()) === "active").length; |
| 714 | return [ | 717 | return [ |
| 715 | - { id: "graded", label: "Değerlendirildi", value: Math.max(1, Math.ceil(total * 0.6)), colorClass: "bg-emerald-500" }, | 718 | + { id: "graded", label: copy("Değerlendirildi", "Graded"), value: Math.max(1, Math.ceil(total * 0.6)), colorClass: "bg-emerald-500" }, |
| 716 | - { id: "pending", label: "Okuma Bekliyor", value: Math.max(1, Math.floor(total * 0.4)), colorClass: "bg-amber-500" }, | 719 | + { id: "pending", label: copy("Okuma Bekliyor", "Awaiting grading"), value: Math.max(1, Math.floor(total * 0.4)), colorClass: "bg-amber-500" }, |
| 717 | - { id: "active", label: "Canlı Sınav", value: active, colorClass: "bg-indigo-500" }, | 720 | + { id: "active", label: copy("Canlı Sınav", "Live exam"), value: active, colorClass: "bg-indigo-500" }, |
| 718 | ]; | 721 | ]; |
| 719 | }); | 722 | }); |
| 720 | 723 | ||
| 721 | const managerCourseKindItems = createMemo<ChartBarItem[]>(() => [ | 724 | const managerCourseKindItems = createMemo<ChartBarItem[]>(() => [ |
| 722 | - { id: "courses", label: "Ders Programları", value: courseCount(), formattedValue: `${courseCount()} ders`, colorClass: "bg-emerald-500" }, | 725 | + { id: "courses", label: copy("Ders Programları", "Courses"), value: courseCount(), formattedValue: countLabel(courseCount(), "ders", "courses"), colorClass: "bg-emerald-500" }, |
| 723 | - { id: "studies", label: "Etüt Seansları", value: studyCount(), formattedValue: `${studyCount()} etüt`, colorClass: "bg-amber-500" }, | 726 | + { id: "studies", label: copy("Etüt Seansları", "Study sessions"), value: studyCount(), formattedValue: countLabel(studyCount(), "etüt", "study sessions"), colorClass: "bg-amber-500" }, |
| 724 | - { id: "clubs", label: "Sosyal Kulüpler", value: clubCount(), formattedValue: `${clubCount()} kulüp`, colorClass: "bg-indigo-500" }, | 727 | + { id: "clubs", label: copy("Sosyal Kulüpler", "Clubs"), value: clubCount(), formattedValue: countLabel(clubCount(), "kulüp", "clubs"), colorClass: "bg-indigo-500" }, |
| 725 | ]); | 728 | ]); |
| 726 | 729 | ||
| 727 | const managerStaffWorkSegments = createMemo<ProgressRingSegment[]>(() => [ | 730 | const managerStaffWorkSegments = createMemo<ProgressRingSegment[]>(() => [ |
| 728 | - { id: "completed", label: "Tamamlanan Mesai", value: 42, colorClass: "bg-emerald-500" }, | 731 | + { id: "completed", label: copy("Tamamlanan Mesai", "Completed work"), value: 42, colorClass: "bg-emerald-500" }, |
| 729 | - { id: "active", label: "Devam Eden Vardiya", value: 8, colorClass: "bg-indigo-500" }, | 732 | + { id: "active", label: copy("Devam Eden Vardiya", "Active shifts"), value: 8, colorClass: "bg-indigo-500" }, |
| 730 | - { id: "pending", label: "Planlanan Görev", value: 6, colorClass: "bg-amber-500" }, | 733 | + { id: "pending", label: copy("Planlanan Görev", "Planned tasks"), value: 6, colorClass: "bg-amber-500" }, |
| 731 | ]); | 734 | ]); |
| 732 | 735 | ||
| 733 | const adminUserRoleItems = createMemo<ChartBarItem[]>(() => [ | 736 | const adminUserRoleItems = createMemo<ChartBarItem[]>(() => [ |
| 734 | - { id: "students", label: "Öğrenciler", value: 140, formattedValue: "140 kişi", colorClass: "bg-emerald-500" }, | 737 | + { id: "students", label: copy("Öğrenciler", "Students"), value: 140, formattedValue: countLabel(140, "kişi", "people"), colorClass: "bg-emerald-500" }, |
| 735 | - { id: "teachers", label: "Öğretmenler", value: 24, formattedValue: "24 kişi", colorClass: "bg-indigo-500" }, | 738 | + { id: "teachers", label: copy("Öğretmenler", "Teachers"), value: 24, formattedValue: countLabel(24, "kişi", "people"), colorClass: "bg-indigo-500" }, |
| 736 | - { id: "parents", label: "Veliler", value: 110, formattedValue: "110 kişi", colorClass: "bg-sky-500" }, | 739 | + { id: "parents", label: copy("Veliler", "Parents"), value: 110, formattedValue: countLabel(110, "kişi", "people"), colorClass: "bg-sky-500" }, |
| 737 | - { id: "managers", label: "Yöneticiler", value: 6, formattedValue: "6 kişi", colorClass: "bg-amber-500" }, | 740 | + { id: "managers", label: copy("Yöneticiler", "Managers"), value: 6, formattedValue: countLabel(6, "kişi", "people"), colorClass: "bg-amber-500" }, |
| 738 | - { id: "admins", label: "Sistem Adminleri", value: 2, formattedValue: "2 kişi", colorClass: "bg-purple-500" }, | 741 | + { id: "admins", label: copy("Sistem Adminleri", "System admins"), value: 2, formattedValue: countLabel(2, "kişi", "people"), colorClass: "bg-purple-500" }, |
| 739 | ]); | 742 | ]); |
| 740 | 743 | ||
| 741 | const adminSystemCapacitySegments = createMemo<ProgressRingSegment[]>(() => [ | 744 | const adminSystemCapacitySegments = createMemo<ProgressRingSegment[]>(() => [ |
| 742 | - { id: "courses", label: "Aktif Dersler", value: courseCount(), colorClass: "bg-emerald-500" }, | 745 | + { id: "courses", label: copy("Aktif Dersler", "Active courses"), value: courseCount(), colorClass: "bg-emerald-500" }, |
| 743 | - { id: "exams", label: "Sınav Kayıtları", value: examCount(), colorClass: "bg-amber-500" }, | 746 | + { id: "exams", label: copy("Sınav Kayıtları", "Exam records"), value: examCount(), colorClass: "bg-amber-500" }, |
| 744 | - { id: "events", label: "Etkinlikler", value: eventCount(), colorClass: "bg-indigo-500" }, | 747 | + { id: "events", label: copy("Etkinlikler", "Events"), value: eventCount(), colorClass: "bg-indigo-500" }, |
| 745 | ]); | 748 | ]); |
| 746 | 749 | ||
| 747 | const [serverPing, setServerPing] = createSignal<{ latency: number; status: string } | null>(null); | 750 | const [serverPing, setServerPing] = createSignal<{ latency: number; status: string } | null>(null); |
| @@ -751,25 +754,25 @@ function DashboardContent() { | |||
| 751 | getTime() | 754 | getTime() |
| 752 | .then(() => { | 755 | .then(() => { |
| 753 | const latency = Math.max(1, Math.round(performance.now() - t0)); | 756 | const latency = Math.max(1, Math.round(performance.now() - t0)); |
| 754 | - setServerPing({ latency, status: "Erişilebilir" }); | 757 | + setServerPing({ latency, status: "reachable" }); |
| 755 | }) | 758 | }) |
| 756 | .catch(() => { | 759 | .catch(() => { |
| 757 | - setServerPing({ latency: 0, status: "Çevrimdışı" }); | 760 | + setServerPing({ latency: 0, status: "offline" }); |
| 758 | }); | 761 | }); |
| 759 | }); | 762 | }); |
| 760 | 763 | ||
| 761 | const adminMetricCards = createMemo<ChartMetricCardItem[]>(() => [ | 764 | const adminMetricCards = createMemo<ChartMetricCardItem[]>(() => [ |
| 762 | - { id: "users", label: "Aktif Kullanıcılar", value: "282", change: "+12 bu ay", isPositive: true, subtext: "Platform geneli" }, | 765 | + { id: "users", label: copy("Aktif Kullanıcılar", "Active users"), value: "282", change: copy("+12 bu ay", "+12 this month"), isPositive: true, subtext: copy("Platform geneli", "Platform-wide") }, |
| 763 | { | 766 | { |
| 764 | id: "uptime", | 767 | id: "uptime", |
| 765 | - label: "Sunucu Yanıt Süresi", | 768 | + label: copy("Sunucu Yanıt Süresi", "Server response time"), |
| 766 | value: serverPing() ? `${serverPing()!.latency} ms` : "—", | 769 | value: serverPing() ? `${serverPing()!.latency} ms` : "—", |
| 767 | - change: serverPing() ? serverPing()!.status : "Ölçülüyor", | 770 | + change: serverPing() ? serverPing()!.status === "reachable" ? copy("Erişilebilir", "Reachable") : copy("Çevrimdışı", "Offline") : copy("Ölçülüyor", "Measuring"), |
| 768 | - isPositive: serverPing()?.status === "Erişilebilir", | 771 | + isPositive: serverPing()?.status === "reachable", |
| 769 | - subtext: "Canlı ping", | 772 | + subtext: copy("Canlı ping", "Live ping"), |
| 770 | }, | 773 | }, |
| 771 | - { id: "courses", label: "Aktif Ders Kaydı", value: String(courseCount()), subtext: "Müfredat dersi" }, | 774 | + { id: "courses", label: copy("Aktif Ders Kaydı", "Active course records"), value: String(courseCount()), subtext: copy("Müfredat dersi", "Curriculum courses") }, |
| 772 | - { id: "exams", label: "Sınav Havuzu", value: String(examCount()), subtext: "Tüm sınavlar" }, | 775 | + { id: "exams", label: copy("Sınav Havuzu", "Exam pool"), value: String(examCount()), subtext: copy("Tüm sınavlar", "All exams") }, |
| 773 | ]); | 776 | ]); |
| 774 | 777 | ||
| 775 | const [showAllPortals, setShowAllPortals] = createSignal(false); | 778 | const [showAllPortals, setShowAllPortals] = createSignal(false); |
| @@ -812,21 +815,21 @@ function DashboardContent() { | |||
| 812 | 815 | ||
| 813 | {/* Visual Analytics Panel (4 Distinct Chart Types Grid) */} | 816 | {/* Visual Analytics Panel (4 Distinct Chart Types Grid) */} |
| 814 | <Show when={role() !== "parent"}> | 817 | <Show when={role() !== "parent"}> |
| 815 | - <section class="grid grid-cols-1 gap-5 lg:grid-cols-2" aria-label="Görsel Analiz ve Raporlar"> | 818 | + <section class="grid grid-cols-1 gap-5 lg:grid-cols-2" aria-label={copy("Görsel Analiz ve Raporlar", "Visual analytics and reports")}> |
| 816 | <Switch> | 819 | <Switch> |
| 817 | {/* STUDENT ROLE CHARTS (4 Distinct Types) */} | 820 | {/* STUDENT ROLE CHARTS (4 Distinct Types) */} |
| 818 | <Match when={role() === "student"}> | 821 | <Match when={role() === "student"}> |
| 819 | <ChartMetricCards | 822 | <ChartMetricCards |
| 820 | - title="Öğrenim & Katılım KPI Özeti" | 823 | + title={copy("Öğrenim & Katılım KPI Özeti", "Learning and attendance KPI summary")} |
| 821 | - subtitle="Genel başarı notu, katılım ve not sayıları" | 824 | + subtitle={copy("Genel başarı notu, katılım ve not sayıları", "Overall grades, attendance, and note counts")} |
| 822 | metrics={studentMetricCards()} | 825 | metrics={studentMetricCards()} |
| 823 | /> | 826 | /> |
| 824 | 827 | ||
| 825 | <ChartAreaTrend | 828 | <ChartAreaTrend |
| 826 | - title="Sınav & Başarı Not Trendi" | 829 | + title={copy("Sınav & Başarı Not Trendi", "Exam and grade trend")} |
| 827 | - subtitle="Dönem içi sınav notlarının gelişim eğrisi" | 830 | + subtitle={copy("Dönem içi sınav notlarının gelişim eğrisi", "Term exam grade trend")} |
| 828 | items={studentGradeTrendItems()} | 831 | items={studentGradeTrendItems()} |
| 829 | - unit=" Puan" | 832 | + unit={copy(" Puan", " points")} |
| 830 | minScale={50} | 833 | minScale={50} |
| 831 | maxScale={100} | 834 | maxScale={100} |
| 832 | /> | 835 | /> |
| @@ -835,25 +838,25 @@ function DashboardContent() { | |||
| 835 | when={courseMarkItems().length > 0} | 838 | when={courseMarkItems().length > 0} |
| 836 | fallback={ | 839 | fallback={ |
| 837 | <ChartBar | 840 | <ChartBar |
| 838 | - title="Sınav & Zaman Çizelgesi Dağılımı" | 841 | + title={copy("Sınav & Zaman Çizelgesi Dağılımı", "Exam and schedule distribution")} |
| 839 | - subtitle="Aktif, bugün ve 7 gün içerisindeki program yoğunluğu" | 842 | + subtitle={copy("Aktif, bugün ve 7 gün içerisindeki program yoğunluğu", "Active, today, and next 7-day schedule load")} |
| 840 | items={scheduleTimeItems()} | 843 | items={scheduleTimeItems()} |
| 841 | /> | 844 | /> |
| 842 | } | 845 | } |
| 843 | > | 846 | > |
| 844 | <ChartBar | 847 | <ChartBar |
| 845 | - title="Ders Bazlı Başarı Notları" | 848 | + title={copy("Ders Bazlı Başarı Notları", "Course grade performance")} |
| 846 | - subtitle="Kayıtlı dersler geneli ortalama puanlar" | 849 | + subtitle={copy("Kayıtlı dersler geneli ortalama puanlar", "Average scores across enrolled courses")} |
| 847 | items={courseMarkItems()} | 850 | items={courseMarkItems()} |
| 848 | maxScale={100} | 851 | maxScale={100} |
| 849 | /> | 852 | /> |
| 850 | </Show> | 853 | </Show> |
| 851 | 854 | ||
| 852 | <ChartProgressRing | 855 | <ChartProgressRing |
| 853 | - title="Program & Takip Analizi" | 856 | + title={copy("Program & Takip Analizi", "Schedule and tracking analysis")} |
| 854 | valueText={`${attention().length}`} | 857 | valueText={`${attention().length}`} |
| 855 | - subtext="yaklaşan ve aktif kayıt" | 858 | + subtext={copy("yaklaşan ve aktif kayıt", "upcoming and active records")} |
| 856 | - subtitle="Durum bazlı zaman çizelgesi oransal göstergesi" | 859 | + subtitle={copy("Durum bazlı zaman çizelgesi oransal göstergesi", "Status-based schedule ratio")} |
| 857 | segments={scheduleSegments()} | 860 | segments={scheduleSegments()} |
| 858 | /> | 861 | /> |
| 859 | </Match> | 862 | </Match> |
| @@ -861,30 +864,30 @@ function DashboardContent() { | |||
| 861 | {/* TEACHER ROLE CHARTS (4 Distinct Types) */} | 864 | {/* TEACHER ROLE CHARTS (4 Distinct Types) */} |
| 862 | <Match when={role() === "teacher"}> | 865 | <Match when={role() === "teacher"}> |
| 863 | <ChartMetricCards | 866 | <ChartMetricCards |
| 864 | - title="Öğretim & Okuma KPI Özeti" | 867 | + title={copy("Öğretim & Okuma KPI Özeti", "Teaching and grading KPI summary")} |
| 865 | - subtitle="Sorumlu dersler, sınavlar ve ortalama katılım" | 868 | + subtitle={copy("Sorumlu dersler, sınavlar ve ortalama katılım", "Assigned courses, exams, and average attendance")} |
| 866 | metrics={teacherMetricCards()} | 869 | metrics={teacherMetricCards()} |
| 867 | /> | 870 | /> |
| 868 | 871 | ||
| 869 | <ChartAreaTrend | 872 | <ChartAreaTrend |
| 870 | - title="Haftalık Öğretim Yükü Eğrisi" | 873 | + title={copy("Haftalık Öğretim Yükü Eğrisi", "Weekly teaching load")} |
| 871 | - subtitle="Günlük ders ve etüt seans yoğunluğu" | 874 | + subtitle={copy("Günlük ders ve etüt seans yoğunluğu", "Daily course and study-session load")} |
| 872 | items={weeklyDensityItems().map((i) => ({ label: i.label, value: i.value, formattedValue: i.formattedValue }))} | 875 | items={weeklyDensityItems().map((i) => ({ label: i.label, value: i.value, formattedValue: i.formattedValue }))} |
| 873 | - unit=" Seans" | 876 | + unit={copy(" Seans", " sessions")} |
| 874 | /> | 877 | /> |
| 875 | 878 | ||
| 876 | <ChartBar | 879 | <ChartBar |
| 877 | - title="Ders Öğretim Başarı Notları" | 880 | + title={copy("Ders Öğretim Başarı Notları", "Teaching grade performance")} |
| 878 | - subtitle="Sorumlu olunan derslerdeki öğrenci ortalamaları" | 881 | + subtitle={copy("Sorumlu olunan derslerdeki öğrenci ortalamaları", "Student averages in assigned courses")} |
| 879 | items={teacherCourseStats()} | 882 | items={teacherCourseStats()} |
| 880 | maxScale={100} | 883 | maxScale={100} |
| 881 | /> | 884 | /> |
| 882 | 885 | ||
| 883 | <ChartProgressRing | 886 | <ChartProgressRing |
| 884 | - title="Sınav Değerlendirme & Okuma Durumu" | 887 | + title={copy("Sınav Değerlendirme & Okuma Durumu", "Exam grading status")} |
| 885 | valueText={`${examCount()}`} | 888 | valueText={`${examCount()}`} |
| 886 | - subtext="toplam sınav" | 889 | + subtext={copy("toplam sınav", "total exams")} |
| 887 | - subtitle="Tamamlanan, okuma bekleyen ve canlı sınavlar" | 890 | + subtitle={copy("Tamamlanan, okuma bekleyen ve canlı sınavlar", "Graded, awaiting grading, and live exams")} |
| 888 | segments={teacherExamStatusSegments()} | 891 | segments={teacherExamStatusSegments()} |
| 889 | /> | 892 | /> |
| 890 | </Match> | 893 | </Match> |
| @@ -892,29 +895,29 @@ function DashboardContent() { | |||
| 892 | {/* MANAGER ROLE CHARTS (4 Distinct Types) */} | 895 | {/* MANAGER ROLE CHARTS (4 Distinct Types) */} |
| 893 | <Match when={role() === "manager"}> | 896 | <Match when={role() === "manager"}> |
| 894 | <ChartMetricCards | 897 | <ChartMetricCards |
| 895 | - title="Kurumsal Performans KPI Özeti" | 898 | + title={copy("Kurumsal Performans KPI Özeti", "Institutional performance KPI summary")} |
| 896 | - subtitle="Okul başarısı, devamlılık ve personel mesai durumu" | 899 | + subtitle={copy("Okul başarısı, devamlılık ve personel mesai durumu", "School performance, attendance, and staff work status")} |
| 897 | metrics={managerMetricCards()} | 900 | metrics={managerMetricCards()} |
| 898 | /> | 901 | /> |
| 899 | 902 | ||
| 900 | <ChartAreaTrend | 903 | <ChartAreaTrend |
| 901 | - title="Okul Geneli 7 Günlük Etkinlik Eğrisi" | 904 | + title={copy("Okul Geneli 7 Günlük Etkinlik Eğrisi", "School-wide 7-day activity")} |
| 902 | - subtitle="Önümüzdeki 7 güne ait etkinlik ve sınav yoğunluğu" | 905 | + subtitle={copy("Önümüzdeki 7 güne ait etkinlik ve sınav yoğunluğu", "Events and exams over the next 7 days")} |
| 903 | items={weeklyDensityItems().map((i) => ({ label: i.label, value: i.value, formattedValue: i.formattedValue }))} | 906 | items={weeklyDensityItems().map((i) => ({ label: i.label, value: i.value, formattedValue: i.formattedValue }))} |
| 904 | - unit=" Etkinlik" | 907 | + unit={copy(" Etkinlik", " events")} |
| 905 | /> | 908 | /> |
| 906 | 909 | ||
| 907 | <ChartBar | 910 | <ChartBar |
| 908 | - title="Kurumsal Program Türü Dağılımı" | 911 | + title={copy("Kurumsal Program Türü Dağılımı", "Program type distribution")} |
| 909 | - subtitle="Aktif ders, etüt ve kulüp sayıları" | 912 | + subtitle={copy("Aktif ders, etüt ve kulüp sayıları", "Active course, study, and club counts")} |
| 910 | items={managerCourseKindItems()} | 913 | items={managerCourseKindItems()} |
| 911 | /> | 914 | /> |
| 912 | 915 | ||
| 913 | <ChartProgressRing | 916 | <ChartProgressRing |
| 914 | - title="Personel Vardiya & Mesai Takibi" | 917 | + title={copy("Personel Vardiya & Mesai Takibi", "Staff shifts and work tracking")} |
| 915 | valueText="88%" | 918 | valueText="88%" |
| 916 | - subtext="Tamamlanan mesai" | 919 | + subtext={copy("Tamamlanan mesai", "completed work")} |
| 917 | - subtitle="Personel çalışma ve vardiya takip durumu" | 920 | + subtitle={copy("Personel çalışma ve vardiya takip durumu", "Staff work and shift status")} |
| 918 | segments={managerStaffWorkSegments()} | 921 | segments={managerStaffWorkSegments()} |
| 919 | /> | 922 | /> |
| 920 | </Match> | 923 | </Match> |
| @@ -922,29 +925,29 @@ function DashboardContent() { | |||
| 922 | {/* ADMIN ROLE CHARTS (4 Distinct Types) */} | 925 | {/* ADMIN ROLE CHARTS (4 Distinct Types) */} |
| 923 | <Match when={role() === "admin"}> | 926 | <Match when={role() === "admin"}> |
| 924 | <ChartMetricCards | 927 | <ChartMetricCards |
| 925 | - title="Sistem Altyapı & Sağlık Metrikleri" | 928 | + title={copy("Sistem Altyapı & Sağlık Metrikleri", "System health metrics")} |
| 926 | - subtitle="Platform geneli kullanıcı, erişilebilirlik ve içerik sayıları" | 929 | + subtitle={copy("Platform geneli kullanıcı, erişilebilirlik ve içerik sayıları", "Platform users, availability, and content counts")} |
| 927 | metrics={adminMetricCards()} | 930 | metrics={adminMetricCards()} |
| 928 | /> | 931 | /> |
| 929 | 932 | ||
| 930 | <ChartAreaTrend | 933 | <ChartAreaTrend |
| 931 | - title="Platform Geneli 7 Günlük Aktivite Eğrisi" | 934 | + title={copy("Platform Geneli 7 Günlük Aktivite Eğrisi", "Platform-wide 7-day activity")} |
| 932 | - subtitle="Tüm modüller genelinde 7 günlük takvim yükü" | 935 | + subtitle={copy("Tüm modüller genelinde 7 günlük takvim yükü", "7-day calendar load across all modules")} |
| 933 | items={weeklyDensityItems().map((i) => ({ label: i.label, value: i.value, formattedValue: i.formattedValue }))} | 936 | items={weeklyDensityItems().map((i) => ({ label: i.label, value: i.value, formattedValue: i.formattedValue }))} |
| 934 | - unit=" Kayıt" | 937 | + unit={copy(" Kayıt", " records")} |
| 935 | /> | 938 | /> |
| 936 | 939 | ||
| 937 | <ChartBar | 940 | <ChartBar |
| 938 | - title="Sistem Kullanıcı & Rol Dağılımı" | 941 | + title={copy("Sistem Kullanıcı & Rol Dağılımı", "System users and roles")} |
| 939 | - subtitle="Platformdaki aktif kullanıcı rollerinin dağılımı" | 942 | + subtitle={copy("Platformdaki aktif kullanıcı rollerinin dağılımı", "Active platform user roles")} |
| 940 | items={adminUserRoleItems()} | 943 | items={adminUserRoleItems()} |
| 941 | /> | 944 | /> |
| 942 | 945 | ||
| 943 | <ChartProgressRing | 946 | <ChartProgressRing |
| 944 | - title="Sistem Altyapı & Kapasite Takibi" | 947 | + title={copy("Sistem Altyapı & Kapasite Takibi", "System capacity tracking")} |
| 945 | valueText={`${courseCount() + examCount() + eventCount()}`} | 948 | valueText={`${courseCount() + examCount() + eventCount()}`} |
| 946 | - subtext="toplam varlık" | 949 | + subtext={copy("toplam varlık", "total assets")} |
| 947 | - subtitle="Sistemdeki aktif ders, sınav ve etkinlik kapasitesi" | 950 | + subtitle={copy("Sistemdeki aktif ders, sınav ve etkinlik kapasitesi", "Active course, exam, and event capacity")} |
| 948 | segments={adminSystemCapacitySegments()} | 951 | segments={adminSystemCapacitySegments()} |
| 949 | /> | 952 | /> |
| 950 | </Match> | 953 | </Match> |
| @@ -1014,7 +1017,7 @@ function DashboardContent() { | |||
| 1014 | class="h-8 rounded-full border-border/70 bg-background/80 px-4 text-xs font-medium text-foreground shadow-xs transition-all duration-200 hover:border-primary/50 hover:bg-card hover:shadow-sm" | 1017 | class="h-8 rounded-full border-border/70 bg-background/80 px-4 text-xs font-medium text-foreground shadow-xs transition-all duration-200 hover:border-primary/50 hover:bg-card hover:shadow-sm" |
| 1015 | onClick={() => setShowAllPortals((v) => !v)} | 1018 | onClick={() => setShowAllPortals((v) => !v)} |
| 1016 | > | 1019 | > |
| 1017 | - <span>{showAllPortals() ? "Daha az göster" : "Daha fazla göster"}</span> | 1020 | + <span>{showAllPortals() ? copy("Daha az göster", "Show less") : copy("Daha fazla göster", "Show more")}</span> |
| 1018 | <Show when={showAllPortals()} fallback={<IconChevronDown class="h-3.5 w-3.5 text-muted-foreground ml-1" />}> | 1021 | <Show when={showAllPortals()} fallback={<IconChevronDown class="h-3.5 w-3.5 text-muted-foreground ml-1" />}> |
| 1019 | <IconChevronUp class="h-3.5 w-3.5 text-muted-foreground ml-1" /> | 1022 | <IconChevronUp class="h-3.5 w-3.5 text-muted-foreground ml-1" /> |
| 1020 | </Show> | 1023 | </Show> |
| @@ -1041,7 +1044,7 @@ function DashboardContent() { | |||
| 1041 | )} | 1044 | )} |
| 1042 | onClick={() => { setAttentionFilter("all"); setAttentionPage(0); }} | 1045 | onClick={() => { setAttentionFilter("all"); setAttentionPage(0); }} |
| 1043 | > | 1046 | > |
| 1044 | - Tümü | 1047 | + {copy("Tümü", "All")} |
| 1045 | </button> | 1048 | </button> |
| 1046 | <button | 1049 | <button |
| 1047 | type="button" | 1050 | type="button" |
| @@ -1053,7 +1056,7 @@ function DashboardContent() { | |||
| 1053 | )} | 1056 | )} |
| 1054 | onClick={() => { setAttentionFilter("exam"); setAttentionPage(0); }} | 1057 | onClick={() => { setAttentionFilter("exam"); setAttentionPage(0); }} |
| 1055 | > | 1058 | > |
| 1056 | - Sınavlar | 1059 | + {copy("Sınavlar", "Exams")} |
| 1057 | </button> | 1060 | </button> |
| 1058 | <button | 1061 | <button |
| 1059 | type="button" | 1062 | type="button" |
| @@ -1065,7 +1068,7 @@ function DashboardContent() { | |||
| 1065 | )} | 1068 | )} |
| 1066 | onClick={() => { setAttentionFilter("event"); setAttentionPage(0); }} | 1069 | onClick={() => { setAttentionFilter("event"); setAttentionPage(0); }} |
| 1067 | > | 1070 | > |
| 1068 | - Etkinlikler | 1071 | + {copy("Etkinlikler", "Events")} |
| 1069 | </button> | 1072 | </button> |
| 1070 | </div> | 1073 | </div> |
| 1071 | </div> | 1074 | </div> |
| @@ -1143,6 +1146,7 @@ function PortalCard(props: { | |||
| 1143 | onDrop: (target: string) => void; | 1146 | onDrop: (target: string) => void; |
| 1144 | }) { | 1147 | }) { |
| 1145 | const t = useT(); | 1148 | const t = useT(); |
| 1149 | + const { locale } = usePreferences(); | ||
| 1146 | const Icon = props.card.Icon; | 1150 | const Icon = props.card.Icon; |
| 1147 | const hasStat = () => props.card.stat != null && props.card.stat !== ""; | 1151 | const hasStat = () => props.card.stat != null && props.card.stat !== ""; |
| 1148 | 1152 | ||
| @@ -1186,7 +1190,7 @@ function PortalCard(props: { | |||
| 1186 | e.stopPropagation(); | 1190 | e.stopPropagation(); |
| 1187 | props.onMoveLeft?.(); | 1191 | props.onMoveLeft?.(); |
| 1188 | }} | 1192 | }} |
| 1189 | - title="Move Earlier" | 1193 | + title={locale() === "tr" ? "Öne taşı" : "Move earlier"} |
| 1190 | > | 1194 | > |
| 1191 | ← | 1195 | ← |
| 1192 | </Button> | 1196 | </Button> |
| @@ -1201,7 +1205,7 @@ function PortalCard(props: { | |||
| 1201 | e.stopPropagation(); | 1205 | e.stopPropagation(); |
| 1202 | props.onMoveRight?.(); | 1206 | props.onMoveRight?.(); |
| 1203 | }} | 1207 | }} |
| 1204 | - title="Move Later" | 1208 | + title={locale() === "tr" ? "Arkaya taşı" : "Move later"} |
| 1205 | > | 1209 | > |
| 1206 | → | 1210 | → |
| 1207 | </Button> | 1211 | </Button> |