forge
Explore
Log in

Don't you dare go Hollow

🌍 close the i18n gaps a locale switch exposed

Browse files at this commit

b9bf08bcc3a044a842bb7104a2ce7f94f45284e7Burak BoduroğluParent: faaf9bc
  • fix
    • 🌍 close the i18n gaps a locale switch exposed
Show full message
fix: 🌍 close the i18n gaps a locale switch exposed
- switching the app to English surfaced 21 strings that never went through
  the dictionary and stayed Turkish: the rich-text toolbar's seven tips,
  six message controls and three placeholders, the notebook import button
  and panel, the command palette and table search clear buttons, and the
  question pool's delete confirmation
- /guide was Turkish end to end apart from its heading. Its 77 strings now
  live in the dictionary, and the page keeps only presentation in its
  arrays — the six module cards and the four role tabs render from <For>
  instead of 220 lines of copy-paste
- the language tip claimed the switcher sits under the avatar at the top
  right; it is the account menu at the bottom of the sidebar
- a page without a sidebar entry printed its raw pathname as the shell
  title, so /profile/me read as "/profile/me". Routes now fall back to an
  explicit label, and to the nav entry for any role — a page keeps its
  name on the no-access screen
- one sidebar entry and its page disagreed: "Çocuklar" against
  "Öğrencilerim" for /students. Both read "Çocuklarım" now
- 33 labels mixed Title Case into a system that is otherwise sentence
  case, in both locales — messages, the question pool, the exam forms,
  payments, and the shell's right panel
- role.admin was the only role shouted in caps; a role is an identity, not
  a status, so RoleBadge drops the semantic destructive variant for a
  tinted pill with a leading dot
- a course card's kind badge was plural ("Dersler") on a single record,
  and "Yeni {item} oluştur" capitalised the kind mid-sentence
- drop 36 guide.stepN.* keys and nav.myStudents, defined in both locales
  and referenced nowhere
src/components/layout/app-shell.tsxmodified+3 -3
@@ -6,7 +6,7 @@ import { CommandPalette } from "@/components/layout/command-palette";
6 import { MobileTabBar } from "@/components/layout/mobile-tab-bar";6 import { MobileTabBar } from "@/components/layout/mobile-tab-bar";
7 import { NavBar } from "@/components/layout/nav-bar";7 import { NavBar } from "@/components/layout/nav-bar";
8 import { NotificationCenter } from "@/components/layout/notification-center";8 import { NotificationCenter } from "@/components/layout/notification-center";
9-import { routeNavItem } from "@/components/layout/nav-items";9+import { routeLabelKey } from "@/components/layout/nav-items";
10 import { ShellMessagesButton } from "@/components/layout/shell-messages-button";10 import { ShellMessagesButton } from "@/components/layout/shell-messages-button";
11 import { SideNav } from "@/components/layout/side-nav";11 import { SideNav } from "@/components/layout/side-nav";
12 import { SidebarAccount } from "@/components/layout/sidebar-account";12 import { SidebarAccount } from "@/components/layout/sidebar-account";
@@ -35,8 +35,8 @@ export function AppShell(props: ParentProps) {
35 const wide = () => location().pathname.startsWith("/exam-room/") || location().searchStr.includes("answerUser=") || location().pathname === "/messages";35 const wide = () => location().pathname.startsWith("/exam-room/") || location().searchStr.includes("answerUser=") || location().pathname === "/messages";
36 const fullScreen = () => location().pathname.startsWith("/exam-room/");36 const fullScreen = () => location().pathname.startsWith("/exam-room/");
37 const routeLabel = createMemo(() => {37 const routeLabel = createMemo(() => {
38- const item = routeNavItem(location().pathname, auth.user()?.role);38+ const key = routeLabelKey(location().pathname, auth.user()?.role);
39- return item ? t(item.labelKey) : location().pathname;39+ return key ? t(key) : "";
40 });40 });
41 const logout = async () => {41 const logout = async () => {
42 await auth.logout();42 await auth.logout();
src/components/layout/command-palette.tsxmodified+1 -1
@@ -382,7 +382,7 @@ export function CommandPalette(props: CommandPaletteProps) {
382 setQuery("");382 setQuery("");
383 inputRef?.focus();383 inputRef?.focus();
384 }}384 }}
385- title="Aramayı Temizle"385+ title={t("common.clearSearch")}
386 >386 >
387 <IconX class="h-3.5 w-3.5" />387 <IconX class="h-3.5 w-3.5" />
388 </button>388 </button>
src/components/layout/nav-items.test.tsmodified+29 -1
@@ -1,4 +1,4 @@
1-import { pathActive, primaryNavItems, primaryPathActive, routeNavItem, sidebarNavGroups, visibleNavItems } from "@/components/layout/nav-items";1+import { pathActive, primaryNavItems, primaryPathActive, routeLabelKey, routeNavItem, sidebarNavGroups, visibleNavItems } from "@/components/layout/nav-items";
2 2
3 test.each([3 test.each([
4 ["student", ["/", "/courses", "/calendar", "/marks"]],4 ["student", ["/", "/courses", "/calendar", "/marks"]],
@@ -69,3 +69,31 @@ test.each([
69 69
70 expect(items.filter((item) => item.id === current?.id).map((item) => item.id)).toEqual([expected]);70 expect(items.filter((item) => item.id === current?.id).map((item) => item.id)).toEqual([expected]);
71 });71 });
72+
73+// The shell header used to print the raw pathname for any route without a
74+// sidebar entry, so /profile/me read as "/profile/me".
75+test.each([
76+ ["/profile/me", "profile.myProfile"],
77+ ["/profile/u-1", "profile.title"],
78+ ["/guide", "nav.guide"],
79+ ["/attendance", "nav.attendance"],
80+ ["/studies", "courses.kind.study"],
81+ ["/clubs", "courses.kind.club"],
82+] as const)("%s has a header label", (pathname, expected) => {
83+ expect(routeLabelKey(pathname, "student")).toBe(expected);
84+});
85+
86+test("routes with a sidebar entry still take their nav label", () => {
87+ expect(routeLabelKey("/courses/course-1", "teacher")).toBe(routeNavItem("/courses/course-1", "teacher")?.labelKey);
88+});
89+
90+test("a route rendered outside the shell has no label rather than a raw path", () => {
91+ expect(routeLabelKey("/login", undefined)).toBeUndefined();
92+});
93+
94+test("a page keeps its name for a viewer who may not open it", () => {
95+ // /students is parent-only; an admin lands on the no-access screen, and the
96+ // shell header must still say what page that is.
97+ expect(routeLabelKey("/students", "admin")).toBe("nav.children");
98+ expect(routeLabelKey("/students", "parent")).toBe("nav.children");
99+});
src/components/layout/nav-items.tsmodified+36 -0
@@ -229,3 +229,39 @@ export function routeNavItem(pathname: string, role: Role | undefined): NavItem
229 .filter((item) => pathActive(pathname, item.to, item.exact))229 .filter((item) => pathActive(pathname, item.to, item.exact))
230 .sort((a, b) => b.to.length - a.to.length)[0];230 .sort((a, b) => b.to.length - a.to.length)[0];
231 }231 }
232+
233+// Routes that are reachable but carry no sidebar entry — the account menu, a
234+// course-kind view, a deep link. Without these the shell's title falls back to
235+// the raw pathname and the header reads "/profile/me".
236+const UNLISTED_ROUTE_LABELS: { prefix: string; labelKey: MessageKey }[] = [
237+ // Longest prefix first — /profile/me is the viewer's own, every other
238+ // /profile/{id} belongs to somebody else and must not read "My profile".
239+ { prefix: "/profile/me", labelKey: "profile.myProfile" },
240+ { prefix: "/profile", labelKey: "profile.title" },
241+ { prefix: "/guide", labelKey: "nav.guide" },
242+ { prefix: "/attendance", labelKey: "nav.attendance" },
243+ { prefix: "/studies", labelKey: "courses.kind.study" },
244+ { prefix: "/clubs", labelKey: "courses.kind.club" },
245+];
246+
247+/**
248+ * The label the shell header shows for a route: its nav entry when it has one,
249+ * otherwise an explicit fallback. Returns undefined only for routes rendered
250+ * without the shell (login, register, the exam room).
251+ */
252+export function routeLabelKey(pathname: string, role: Role | undefined): MessageKey | undefined {
253+ const item = routeNavItem(pathname, role);
254+ if (item) return item.labelKey;
255+
256+ const unlisted = UNLISTED_ROUTE_LABELS.find(
257+ (entry) => pathname === entry.prefix || pathname.startsWith(`${entry.prefix}/`),
258+ );
259+ if (unlisted) return unlisted.labelKey;
260+
261+ // A page still has a name when the viewer may not open it — the shell title
262+ // must not go blank on the "no access" screen — so fall back to the nav entry
263+ // for any role, not just this one.
264+ return [HOME_ITEM, ...NAV_GROUPS.flatMap((group) => group.items)]
265+ .filter((entry) => pathActive(pathname, entry.to, entry.exact))
266+ .sort((a, b) => b.to.length - a.to.length)[0]?.labelKey;
267+}
src/components/layout/role-badge.tsxmodified+28 -10
@@ -1,21 +1,39 @@
1 import type { Role } from "@/api/client";1 import type { Role } from "@/api/client";
2 import type { MessageKey } from "@/i18n/messages";2 import type { MessageKey } from "@/i18n/messages";
3-import { Badge } from "@/components/ui/badge";3+import { cn } from "@/lib/cn";
4 import { useT } from "@/stores/preferences-context";4 import { useT } from "@/stores/preferences-context";
5 5
6-const VARIANT: Record<Role, "default" | "secondary" | "outline" | "destructive"> = {6+// A role is an identity, not a status, so it reads as a tinted pill with a
7- student: "secondary",7+// leading dot rather than borrowing the semantic success/destructive variants —
8- parent: "secondary",8+// an admin is not an error. Ranked warm-to-cool from most to least privileged.
9- teacher: "default",9+const TONE: Record<Role, string> = {
10- manager: "outline",10+ parent: "bg-sky-500/10 text-sky-700 ring-sky-500/25 dark:text-sky-300",
11- admin: "destructive",11+ student: "bg-emerald-500/10 text-emerald-700 ring-emerald-500/25 dark:text-emerald-300",
12+ teacher: "bg-violet-500/10 text-violet-700 ring-violet-500/25 dark:text-violet-300",
13+ manager: "bg-amber-500/10 text-amber-700 ring-amber-500/25 dark:text-amber-300",
14+ admin: "bg-rose-500/10 text-rose-700 ring-rose-500/25 dark:text-rose-300",
12 };15 };
13 16
14-export function RoleBadge(props: { role: Role }) {17+const DOT: Record<Role, string> = {
18+ parent: "bg-sky-500",
19+ student: "bg-emerald-500",
20+ teacher: "bg-violet-500",
21+ manager: "bg-amber-500",
22+ admin: "bg-rose-500",
23+};
24+
25+export function RoleBadge(props: { role: Role; class?: string }) {
15 const t = useT();26 const t = useT();
16 return (27 return (
17- <Badge variant={VARIANT[props.role]} class="rounded-sm capitalize">28+ <span
29+ class={cn(
30+ "inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ring-1 ring-inset",
31+ TONE[props.role],
32+ props.class,
33+ )}
34+ >
35+ <span class={cn("h-1.5 w-1.5 shrink-0 rounded-full", DOT[props.role])} />
18 {t(`role.${props.role}` as MessageKey)}36 {t(`role.${props.role}` as MessageKey)}
19- </Badge>37+ </span>
20 );38 );
21 }39 }
src/components/layout/sidebar-account.tsxmodified+14 -14
@@ -12,10 +12,10 @@ import {
12 } from "@/components/ui/dropdown-menu";12 } from "@/components/ui/dropdown-menu";
13 import { IconChevronRight, IconGlobe, IconGuide, IconLogout, IconSettings } from "@/components/ui/icons";13 import { IconChevronRight, IconGlobe, IconGuide, IconLogout, IconSettings } from "@/components/ui/icons";
14 import { ThemeModeControl } from "@/components/layout/theme-mode-control";14 import { ThemeModeControl } from "@/components/layout/theme-mode-control";
15+import { UserAvatar } from "@/components/users/user-avatar";
15 import { useAuth } from "@/stores/auth-context";16 import { useAuth } from "@/stores/auth-context";
16 import { usePreferences, useT } from "@/stores/preferences-context";17 import { usePreferences, useT } from "@/stores/preferences-context";
17 import { cn } from "@/lib/cn";18 import { cn } from "@/lib/cn";
18-import { personInitials } from "@/lib/person";
19 19
20 function displayName(user: User) {20 function displayName(user: User) {
21 return [user.name, user.surname].filter(Boolean).join(" ").trim() || user.username;21 return [user.name, user.surname].filter(Boolean).join(" ").trim() || user.username;
@@ -46,14 +46,12 @@ export function SidebarAccount(props: { collapsed?: boolean; onLogout: () => voi
46 )}46 )}
47 aria-label={t("nav.account")}47 aria-label={t("nav.account")}
48 >48 >
49- <span49+ <UserAvatar
50- class={cn(50+ userId={u().id}
51- "flex shrink-0 items-center justify-center rounded-full bg-primary/15 text-[11px] font-bold text-primary shadow-xs ring-1 ring-border/70 dark:bg-emerald-100 dark:text-emerald-950 dark:ring-white/20",51+ name={name()}
52- props.collapsed ? "h-9 w-9" : "h-8 w-8",52+ size="sm"
53- )}53+ class={props.collapsed ? "h-9 w-9" : undefined}
54- >54+ />
55- {personInitials(name())}
56- </span>
57 <Show when={!props.collapsed}>55 <Show when={!props.collapsed}>
58 <span class="min-w-0 flex-1">56 <span class="min-w-0 flex-1">
59 <span class="block truncate text-[13px] font-semibold leading-4 2xl:text-sm">{name()}</span>57 <span class="block truncate text-[13px] font-semibold leading-4 2xl:text-sm">{name()}</span>
@@ -66,14 +64,16 @@ export function SidebarAccount(props: { collapsed?: boolean; onLogout: () => voi
66 </DropdownMenuTrigger>64 </DropdownMenuTrigger>
67 65
68 <DropdownMenuContent class="w-72 rounded-xl border-border bg-popover p-0 text-popover-foreground shadow-xl shadow-black/10">66 <DropdownMenuContent class="w-72 rounded-xl border-border bg-popover p-0 text-popover-foreground shadow-xl shadow-black/10">
69- <DropdownMenuItem class="m-1.5 gap-2.5 rounded-xl bg-muted/70 p-2.5 focus:bg-muted data-highlighted:bg-muted dark:bg-white/8 dark:focus:bg-white/10 dark:data-highlighted:bg-white/10" onSelect={() => setProfileOpen(true)}>67+ <DropdownMenuItem
70- <span class="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary/15 text-sm font-bold text-primary dark:bg-emerald-100 dark:text-emerald-950">68+ class="m-1.5 gap-2.5 rounded-xl bg-muted/70 p-2.5 focus:bg-muted data-highlighted:bg-muted dark:bg-white/8 dark:focus:bg-white/10 dark:data-highlighted:bg-white/10"
71- {personInitials(name())}69+ onSelect={() => void navigate({ to: "/profile/me" })}
72- </span>70+ >
71+ <UserAvatar userId={u().id} name={name()} size="md" class="ring-0" />
73 <span class="min-w-0 flex-1">72 <span class="min-w-0 flex-1">
74 <span class="block truncate text-sm font-semibold">{name()}</span>73 <span class="block truncate text-sm font-semibold">{name()}</span>
75- <span class="block truncate text-xs text-muted-foreground dark:text-white/60">{u().email || u().username}</span>74+ <span class="block truncate text-xs text-muted-foreground dark:text-white/60">{t("profile.myProfile")}</span>
76 </span>75 </span>
76+ <IconChevronRight class="h-3.5 w-3.5 shrink-0 text-muted-foreground dark:text-white/50" />
77 </DropdownMenuItem>77 </DropdownMenuItem>
78 <div class="px-1.5 pb-1.5">78 <div class="px-1.5 pb-1.5">
79 <DropdownMenuItem class="rounded-lg gap-3" onSelect={() => setProfileOpen(true)}>79 <DropdownMenuItem class="rounded-lg gap-3" onSelect={() => setProfileOpen(true)}>
src/components/messages/gmail-compose-box.tsxmodified+3 -3
@@ -153,7 +153,7 @@ export function GmailComposeBox(props: GmailComposeBoxProps) {
153 </span>153 </span>
154 <Input154 <Input
155 maxlength={50}155 maxlength={50}
156- placeholder="ör. Etüt, Sınav (Opsiyonel)"156+ placeholder={t("messages.labelsPlaceholder")}
157 class="h-8 border-none bg-transparent shadow-none focus-visible:ring-0 text-xs flex-1"157 class="h-8 border-none bg-transparent shadow-none focus-visible:ring-0 text-xs flex-1"
158 value={label()}158 value={label()}
159 onInput={(e) => setLabel(e.currentTarget.value)}159 onInput={(e) => setLabel(e.currentTarget.value)}
@@ -165,7 +165,7 @@ export function GmailComposeBox(props: GmailComposeBoxProps) {
165 <RichTextEditor165 <RichTextEditor
166 value={body()}166 value={body()}
167 onChange={setBody}167 onChange={setBody}
168- placeholder="Mesajınızı buraya yazın..."168+ placeholder={t("messages.bodyPlaceholder")}
169 class="flex-1 min-h-0"169 class="flex-1 min-h-0"
170 />170 />
171 </div>171 </div>
@@ -190,7 +190,7 @@ export function GmailComposeBox(props: GmailComposeBoxProps) {
190 type="button"190 type="button"
191 class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors"191 class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors"
192 onClick={handleClose}192 onClick={handleClose}
193- title="Taslağı Sil"193+ title={t("messages.deleteDraft")}
194 >194 >
195 <IconTrash class="h-4 w-4" />195 <IconTrash class="h-4 w-4" />
196 </button>196 </button>
src/components/messages/gmail-mail-detail.tsxmodified+5 -5
@@ -178,7 +178,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
178 size="sm"178 size="sm"
179 class="h-8 rounded-lg text-xs"179 class="h-8 rounded-lg text-xs"
180 onClick={() => props.onAction({ folder: restoreFolder() })}180 onClick={() => props.onAction({ folder: restoreFolder() })}
181- title="Çöp Kutusundan Çıkar"181+ title={t("messages.restoreFromTrash")}
182 >182 >
183 <IconMessage class="mr-1.5 h-3.5 w-3.5" />183 <IconMessage class="mr-1.5 h-3.5 w-3.5" />
184 Çöp Kutusundan Çıkar184 Çöp Kutusundan Çıkar
@@ -313,14 +313,14 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
313 class="text-xs text-muted-foreground hover:text-foreground"313 class="text-xs text-muted-foreground hover:text-foreground"
314 onClick={() => setIsReplying(false)}314 onClick={() => setIsReplying(false)}
315 >315 >
316- Vazgeç316+ {t("common.cancel")}
317 </button>317 </button>
318 </div>318 </div>
319 319
320 <RichTextEditor320 <RichTextEditor
321 value={replyBody()}321 value={replyBody()}
322 onChange={setReplyBody}322 onChange={setReplyBody}
323- placeholder="Yanıtınızı yazın..."323+ placeholder={t("messages.replyPlaceholder")}
324 minHeight="min-h-[120px]"324 minHeight="min-h-[120px]"
325 />325 />
326 326
@@ -336,14 +336,14 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
336 disabled={sending() || !replyBody().trim()}336 disabled={sending() || !replyBody().trim()}
337 >337 >
338 <IconSend class="mr-2 h-4 w-4" />338 <IconSend class="mr-2 h-4 w-4" />
339- Gönder339+ {t("messages.send")}
340 </Button>340 </Button>
341 341
342 <button342 <button
343 type="button"343 type="button"
344 class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive"344 class="flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive"
345 onClick={() => setIsReplying(false)}345 onClick={() => setIsReplying(false)}
346- title="Vazgeç"346+ title={t("common.cancel")}
347 >347 >
348 <IconTrash class="h-4 w-4" />348 <IconTrash class="h-4 w-4" />
349 </button>349 </button>
src/components/ui/data-table-search.tsxmodified+3 -1
@@ -2,6 +2,7 @@ import { Show } from "solid-js";
2 import { IconSearch, IconX } from "@/components/ui/icons";2 import { IconSearch, IconX } from "@/components/ui/icons";
3 import { Input } from "@/components/ui/input";3 import { Input } from "@/components/ui/input";
4 import { cn } from "@/lib/cn";4 import { cn } from "@/lib/cn";
5+import { useT } from "@/stores/preferences-context";
5 6
6 export type DataTableSearchProps = {7 export type DataTableSearchProps = {
7 value: string;8 value: string;
@@ -12,6 +13,7 @@ export type DataTableSearchProps = {
12 13
13 /** Rounded search field: leading icon + conditional clear (X) button. */14 /** Rounded search field: leading icon + conditional clear (X) button. */
14 export function DataTableSearch(props: DataTableSearchProps) {15 export function DataTableSearch(props: DataTableSearchProps) {
16+ const t = useT();
15 return (17 return (
16 <div class={cn("relative w-full sm:max-w-xs", props.class)}>18 <div class={cn("relative w-full sm:max-w-xs", props.class)}>
17 <IconSearch class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />19 <IconSearch class="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
@@ -24,7 +26,7 @@ export function DataTableSearch(props: DataTableSearchProps) {
24 <Show when={props.value}>26 <Show when={props.value}>
25 <button27 <button
26 type="button"28 type="button"
27- aria-label="Aramayı temizle"29+ aria-label={t("common.clearSearch")}
28 onClick={() => props.onChange("")}30 onClick={() => props.onChange("")}
29 class="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground"31 class="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground"
30 >32 >
src/components/ui/rich-text-editor.tsxmodified+9 -7
@@ -1,5 +1,6 @@
1 import { createSignal, createEffect } from "solid-js";1 import { createSignal, createEffect } from "solid-js";
2 import { cn } from "@/lib/cn";2 import { cn } from "@/lib/cn";
3+import { useT } from "@/stores/preferences-context";
3 4
4 interface RichTextEditorProps {5 interface RichTextEditorProps {
5 value: string;6 value: string;
@@ -10,6 +11,7 @@ interface RichTextEditorProps {
10 }11 }
11 12
12 export function RichTextEditor(props: RichTextEditorProps) {13 export function RichTextEditor(props: RichTextEditorProps) {
14+ const t = useT();
13 let editorRef: HTMLDivElement | undefined;15 let editorRef: HTMLDivElement | undefined;
14 const [isFocused, setIsFocused] = createSignal(false);16 const [isFocused, setIsFocused] = createSignal(false);
15 17
@@ -58,7 +60,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
58 type="button"60 type="button"
59 class="flex h-7 w-7 items-center justify-center rounded font-bold text-xs hover:bg-muted text-foreground"61 class="flex h-7 w-7 items-center justify-center rounded font-bold text-xs hover:bg-muted text-foreground"
60 onClick={() => execCommand("bold")}62 onClick={() => execCommand("bold")}
61- title="Kalın (Ctrl+B)"63+ title={t("editor.bold")}
62 >64 >
63 B65 B
64 </button>66 </button>
@@ -66,7 +68,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
66 type="button"68 type="button"
67 class="flex h-7 w-7 items-center justify-center rounded italic text-xs hover:bg-muted text-foreground"69 class="flex h-7 w-7 items-center justify-center rounded italic text-xs hover:bg-muted text-foreground"
68 onClick={() => execCommand("italic")}70 onClick={() => execCommand("italic")}
69- title="İtalik (Ctrl+I)"71+ title={t("editor.italic")}
70 >72 >
71 I73 I
72 </button>74 </button>
@@ -74,7 +76,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
74 type="button"76 type="button"
75 class="flex h-7 w-7 items-center justify-center rounded underline text-xs hover:bg-muted text-foreground"77 class="flex h-7 w-7 items-center justify-center rounded underline text-xs hover:bg-muted text-foreground"
76 onClick={() => execCommand("underline")}78 onClick={() => execCommand("underline")}
77- title="Altı Çizili (Ctrl+U)"79+ title={t("editor.underline")}
78 >80 >
79 U81 U
80 </button>82 </button>
@@ -82,7 +84,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
82 type="button"84 type="button"
83 class="flex h-7 w-7 items-center justify-center rounded line-through text-xs hover:bg-muted text-foreground"85 class="flex h-7 w-7 items-center justify-center rounded line-through text-xs hover:bg-muted text-foreground"
84 onClick={() => execCommand("strikeThrough")}86 onClick={() => execCommand("strikeThrough")}
85- title="Üstü Çizili"87+ title={t("editor.strike")}
86 >88 >
87 S89 S
88 </button>90 </button>
@@ -93,7 +95,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
93 type="button"95 type="button"
94 class="flex h-7 px-2 items-center justify-center rounded text-xs font-mono hover:bg-muted text-foreground"96 class="flex h-7 px-2 items-center justify-center rounded text-xs font-mono hover:bg-muted text-foreground"
95 onClick={() => execCommand("insertUnorderedList")}97 onClick={() => execCommand("insertUnorderedList")}
96- title="Madde İşaretli Liste"98+ title={t("editor.bulletList")}
97 >99 >
98 • Liste100 • Liste
99 </button>101 </button>
@@ -101,7 +103,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
101 type="button"103 type="button"
102 class="flex h-7 px-2 items-center justify-center rounded text-xs font-mono hover:bg-muted text-foreground"104 class="flex h-7 px-2 items-center justify-center rounded text-xs font-mono hover:bg-muted text-foreground"
103 onClick={() => execCommand("insertOrderedList")}105 onClick={() => execCommand("insertOrderedList")}
104- title="Numaralı Liste"106+ title={t("editor.numberedList")}
105 >107 >
106 1. Liste108 1. Liste
107 </button>109 </button>
@@ -112,7 +114,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
112 type="button"114 type="button"
113 class="flex h-7 px-2 items-center justify-center rounded text-xs hover:bg-muted text-muted-foreground"115 class="flex h-7 px-2 items-center justify-center rounded text-xs hover:bg-muted text-muted-foreground"
114 onClick={() => execCommand("removeFormat")}116 onClick={() => execCommand("removeFormat")}
115- title="Biçimlendirmeyi Temizle"117+ title={t("editor.clearFormatting")}
116 >118 >
117 Biçimi Temizle119 Biçimi Temizle
118 </button>120 </button>
src/lib/course-kind.tsadded+9 -0
@@ -0,0 +1,9 @@
1+import type { MessageKey } from "@/i18n/messages";
2+
3+// `kind` is an open string on the wire, so a value this build has no copy for
4+// falls back to itself rather than rendering a missing translation key.
5+const KNOWN_KINDS = new Set(["course", "study", "club"]);
6+
7+export function courseKindLabel(kind: string, t: (key: MessageKey) => string): string {
8+ return KNOWN_KINDS.has(kind) ? t(`courses.kind.${kind}Singular` as MessageKey) : kind;
9+}
src/pages/courses-page.tsxmodified+8 -4
@@ -18,6 +18,7 @@ import { Label } from "@/components/ui/label";
18 import { PageSpinner } from "@/components/ui/page-spinner";18 import { PageSpinner } from "@/components/ui/page-spinner";
19 import { PaginationControls } from "@/components/ui/pagination-controls";19 import { PaginationControls } from "@/components/ui/pagination-controls";
20 import { Select } from "@/components/ui/select";20 import { Select } from "@/components/ui/select";
21+import { courseKindLabel } from "@/lib/course-kind";
21 import { SidePanel } from "@/components/ui/side-panel";22 import { SidePanel } from "@/components/ui/side-panel";
22 import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";23 import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
23 import { Textarea } from "@/components/ui/textarea";24 import { Textarea } from "@/components/ui/textarea";
@@ -26,7 +27,7 @@ import { createFlash } from "@/lib/flash";
26 import { personLabel } from "@/lib/person";27 import { personLabel } from "@/lib/person";
27 import { hasMinRole } from "@/lib/roles";28 import { hasMinRole } from "@/lib/roles";
28 import { useAuth } from "@/stores/auth-context";29 import { useAuth } from "@/stores/auth-context";
29-import { useT } from "@/stores/preferences-context";30+import { usePreferences, useT } from "@/stores/preferences-context";
30 31
31 const PAGE_SIZE = 10;32 const PAGE_SIZE = 10;
32 33
@@ -39,10 +40,13 @@ function CoursesContent() {
39 const navigate = useNavigate();40 const navigate = useNavigate();
40 const routeSearch = useSearch({ from: "/courses" });41 const routeSearch = useSearch({ from: "/courses" });
41 const t = useT();42 const t = useT();
43+ const prefs = usePreferences();
42 const [pageKind, setPageKind] = createSignal<CourseKind | undefined>(routeSearch().kind);44 const [pageKind, setPageKind] = createSignal<CourseKind | undefined>(routeSearch().kind);
43 const createKind = (): CourseKind => pageKind() ?? "course";45 const createKind = (): CourseKind => pageKind() ?? "course";
44 const pageLabel = () => t("nav.classes");46 const pageLabel = () => t("nav.classes");
45 const kindLabel = () => createKind() === "study" ? t("courses.kind.study") : createKind() === "club" ? t("courses.kind.club") : t("courses.kind.course");47 const kindLabel = () => createKind() === "study" ? t("courses.kind.study") : createKind() === "club" ? t("courses.kind.club") : t("courses.kind.course");
48+ const kindInSentence = () =>
49+ kindLabelSingular().toLocaleLowerCase(prefs.locale() === "tr" ? "tr-TR" : "en-US");
46 const kindLabelSingular = () => createKind() === "study" ? t("courses.kind.studySingular") : createKind() === "club" ? t("courses.kind.clubSingular") : t("courses.kind.courseSingular");50 const kindLabelSingular = () => createKind() === "study" ? t("courses.kind.studySingular") : createKind() === "club" ? t("courses.kind.clubSingular") : t("courses.kind.courseSingular");
47 const canCreate = () => hasMinRole(auth.user()?.role, "teacher");51 const canCreate = () => hasMinRole(auth.user()?.role, "teacher");
48 const [showForm, setShowForm] = createSignal(routeSearch().action === "new");52 const [showForm, setShowForm] = createSignal(routeSearch().action === "new");
@@ -120,7 +124,7 @@ function CoursesContent() {
120 124
121 return (125 return (
122 <div class="space-y-5">126 <div class="space-y-5">
123- <SidePanel open={canCreate() && showForm()} onOpenChange={setShowForm} title={t("common.createItem", { item: kindLabelSingular() })} description={t("courses.subtitle", { item: kindLabel() })}>127+ <SidePanel open={canCreate() && showForm()} onOpenChange={setShowForm} title={t("common.createItem", { item: kindInSentence() })} description={t("courses.subtitle", { item: kindLabel() })}>
124 <form class="space-y-4" onSubmit={createCourse}>128 <form class="space-y-4" onSubmit={createCourse}>
125 <Show when={limits.error}><ErrorAlert message={formatApiError(limits.error)} onRetry={() => void refetchLimits()} /></Show>129 <Show when={limits.error}><ErrorAlert message={formatApiError(limits.error)} onRetry={() => void refetchLimits()} /></Show>
126 <div class="flex items-center justify-between rounded-md border border-border/70 bg-muted/30 px-3 py-2 text-xs text-muted-foreground">130 <div class="flex items-center justify-between rounded-md border border-border/70 bg-muted/30 px-3 py-2 text-xs text-muted-foreground">
@@ -147,7 +151,7 @@ function CoursesContent() {
147 <Show when={canCreate()}>151 <Show when={canCreate()}>
148 <Button size="sm" class="min-w-30 rounded-lg" onClick={() => setShowForm(true)}>152 <Button size="sm" class="min-w-30 rounded-lg" onClick={() => setShowForm(true)}>
149 <IconPlus class="h-4 w-4" />153 <IconPlus class="h-4 w-4" />
150- {t("common.createItem", { item: kindLabelSingular() })}154+ {t("common.createItem", { item: kindInSentence() })}
151 </Button>155 </Button>
152 </Show>156 </Show>
153 </header>157 </header>
@@ -210,7 +214,7 @@ function CoursesContent() {
210 capacity: t("courses.capacity"),214 capacity: t("courses.capacity"),
211 unlimited: t("courses.unlimited"),215 unlimited: t("courses.unlimited"),
212 enrolled: t("courses.enrolled"),216 enrolled: t("courses.enrolled"),
213- kind: course.kind === "study" ? t("courses.kind.study") : course.kind === "club" ? t("courses.kind.club") : t("courses.kind.course"),217+ kind: courseKindLabel(course.kind, t),
214 }}218 }}
215 />219 />
216 )}220 )}
src/pages/guide-page.tsxmodified+117 -268
@@ -1,4 +1,4 @@
1-import { For } from "solid-js";1+import { For, type Component } from "solid-js";
2 import { Link } from "@tanstack/solid-router";2 import { Link } from "@tanstack/solid-router";
3 import { RouteGuard } from "@/components/layout/route-guard";3 import { RouteGuard } from "@/components/layout/route-guard";
4 import { PageHeader } from "@/components/layout/page-header";4 import { PageHeader } from "@/components/layout/page-header";
@@ -21,24 +21,56 @@ import {
21 IconFileText,21 IconFileText,
22 IconChart,22 IconChart,
23 } from "@/components/ui/icons";23 } from "@/components/ui/icons";
24+import type { MessageKey } from "@/i18n/messages";
24 import { useT } from "@/stores/preferences-context";25 import { useT } from "@/stores/preferences-context";
25 import { cn } from "@/lib/cn";26 import { cn } from "@/lib/cn";
26 27
28+// Everything on this page is copy, so the arrays below carry message keys and
29+// presentation only — no literal text, in either locale.
27 type GuideStep = {30 type GuideStep = {
28 id: string;31 id: string;
29 stepNumber: string;32 stepNumber: string;
30- badge: string;
31- badgeTone: string;
32 borderTone: string;33 borderTone: string;
33- icon: any;34+ icon: Component<{ class?: string }>;
34 iconColor: string;35 iconColor: string;
35- title: string;
36- description: string;
37 to: string;36 to: string;
38- cta: string;
39- features: string[];
40 };37 };
41 38
39+const CARD_TONE = "border-sky-500/40 dark:border-sky-500/30 hover:border-sky-500/70 ring-1 ring-sky-500/20";
40+const BADGE_TONE = "border-sky-500/40 text-foreground bg-card";
41+
42+const STEPS: GuideStep[] = [
43+ { id: "ai", stepNumber: "01", borderTone: CARD_TONE, icon: IconSparkles, iconColor: "text-sky-400", to: "/" },
44+ { id: "notes", stepNumber: "02", borderTone: CARD_TONE, icon: IconNote, iconColor: "text-sky-400", to: "/notes" },
45+ { id: "questions", stepNumber: "03", borderTone: CARD_TONE, icon: IconBook, iconColor: "text-sky-400", to: "/questions" },
46+ { id: "courses", stepNumber: "04", borderTone: CARD_TONE, icon: IconCalendarDays, iconColor: "text-sky-400", to: "/courses" },
47+ { id: "exams", stepNumber: "05", borderTone: CARD_TONE, icon: IconExam, iconColor: "text-sky-400", to: "/exams" },
48+ { id: "marks", stepNumber: "06", borderTone: CARD_TONE, icon: IconReportAnalytics, iconColor: "text-sky-400", to: "/marks" },
49+];
50+
51+type RoleTab = {
52+ id: string;
53+ tabKey: MessageKey;
54+ icon: Component<{ class?: string }>;
55+ checkColor: string;
56+};
57+
58+const ROLE_TABS: RoleTab[] = [
59+ { id: "student", tabKey: "role.student", icon: IconSchool, checkColor: "text-emerald-400" },
60+ { id: "teacher", tabKey: "role.teacher", icon: IconClipboardCheck, checkColor: "text-sky-400" },
61+ { id: "parent", tabKey: "role.parent", icon: IconUsers, checkColor: "text-violet-400" },
62+ { id: "admin", tabKey: "guide.roles.adminTab", icon: IconUserCog, checkColor: "text-amber-400" },
63+];
64+
65+const TIPS = [
66+ { id: "locale", icon: IconGlobe, tone: "text-violet-400" },
67+ { id: "sync", icon: IconClock, tone: "text-sky-400" },
68+ { id: "import", icon: IconFileText, tone: "text-amber-400" },
69+ { id: "weights", icon: IconChart, tone: "text-emerald-400" },
70+] satisfies { id: string; icon: Component<{ class?: string }>; tone: string }[];
71+
72+const ITEM_INDEXES = [1, 2, 3, 4] as const;
73+
42 export default function GuidePage() {74 export default function GuidePage() {
43 return (75 return (
44 <RouteGuard>76 <RouteGuard>
@@ -49,266 +81,102 @@ export default function GuidePage() {
49 81
50 function GuideContent() {82 function GuideContent() {
51 const t = useT();83 const t = useT();
52-84+ const stepText = (id: string, field: string) => t(`guide.step.${id}.${field}` as MessageKey);
53- const steps: GuideStep[] = [
54- {
55- id: "ai",
56- stepNumber: "01",
57- badge: "Yapay Zeka",
58- badgeTone: "border-sky-500/40 text-foreground bg-card",
59- borderTone: "border-sky-500/40 dark:border-sky-500/30 hover:border-sky-500/70 ring-1 ring-sky-500/20",
60- icon: IconSparkles,
61- iconColor: "text-sky-400",
62- title: "Çelebi AI Asistanı",
63- description: "Tüm sayfalardan üst barda bulunan 'Çelebi'ye Sor' butonuyla erişilebilir akıllı yapay zeka asistanı. Kampüs verileriniz, ders konularınız ve sistem hakkında anlık yanıtlar verir.",
64- to: "/",
65- cta: "Çelebi'yi Dene",
66- features: ["Tüm sayfalardan tek tıkla erişim", "Kampüs ve ders odaklı yanıtlar", "Bağlamsal çalışma rehberliği"],
67- },
68- {
69- id: "notes",
70- stepNumber: "02",
71- badge: "Notlar & Çizim",
72- badgeTone: "border-sky-500/40 text-foreground bg-card",
73- borderTone: "border-sky-500/40 dark:border-sky-500/30 hover:border-sky-500/70 ring-1 ring-sky-500/20",
74- icon: IconNote,
75- iconColor: "text-sky-400",
76- title: "Akıllı Defter & Çizim Tuvali",
77- description: "PDF, TXT ve Markdown materyallerinizi temiz Markdown notlarına dönüştürün. Dahili .hzdraw tuvali ile derslerinize serbest el çizimleri ve grafikler ekleyin.",
78- to: "/notes",
79- cta: "Notlara Git",
80- features: ["PDF & TXT otomatik dönüştürücü", "Dahili .hzdraw serbest çizim tuvali", "Markdown biçimlendirme ve OCR uyarısı"],
81- },
82- {
83- id: "questions",
84- stepNumber: "03",
85- badge: "Soru Havuzu",
86- badgeTone: "border-sky-500/40 text-foreground bg-card",
87- borderTone: "border-sky-500/40 dark:border-sky-500/30 hover:border-sky-500/70 ring-1 ring-sky-500/20",
88- icon: IconBook,
89- iconColor: "text-sky-400",
90- title: "Soru Havuzu & Çözümler",
91- description: "Topluluk soru havuzunda sorularınızı paylaşın, yazılı ve çoktan seçmeli çözümler ekleyin. Öğretmen onaylı çözümlerle ders konularında uzmanlaşın.",
92- to: "/questions",
93- cta: "Soru Havuzu",
94- features: ["Yazılı ve test çözümleri", "Öğretmen onaylı çözüm rozeti", "Filtrelenebilir konu ve durum kategorileri"],
95- },
96- {
97- id: "courses",
98- stepNumber: "04",
99- badge: "Dersler & Etütler",
100- badgeTone: "border-sky-500/40 text-foreground bg-card",
101- borderTone: "border-sky-500/40 dark:border-sky-500/30 hover:border-sky-500/70 ring-1 ring-sky-500/20",
102- icon: IconCalendarDays,
103- iconColor: "text-sky-400",
104- title: "Dersler, Etütler & Kulüpler",
105- description: "Ders, etüt ve kulüp programı. Öğretmenler öğrenci kaydeder, ders içi oturum yoklaması (Var, Yok, Geç, Mazeretli) alır ve müfredat takibi yapar.",
106- to: "/courses",
107- cta: "Derslerim",
108- features: ["Öğrenci ders kayıt yönetimi", "Anlık oturum yoklaması alma", "Sınav ve etüt takvimi hizalaması"],
109- },
110- {
111- id: "exams",
112- stepNumber: "05",
113- badge: "Sınav Odası",
114- badgeTone: "border-sky-500/40 text-foreground bg-card",
115- borderTone: "border-sky-500/40 dark:border-sky-500/30 hover:border-sky-500/70 ring-1 ring-sky-500/20",
116- icon: IconExam,
117- iconColor: "text-sky-400",
118- title: "Sınav Odası & Canlı Takip",
119- description: "Geri sayım ve otomatik kaydetmeli canlı sınav odası. Öğretmenler canlı izleme panelinden yanıt kağıtlarını ve anlık puanlama önerilerini takip eder.",
120- to: "/exams",
121- cta: "Sınav Odası",
122- features: ["Sunucu saati senkronize geri sayım", "WebSocket & REST otomatik kaydetme", "Canlı öğretmen izleme ve puanlama"],
123- },
124- {
125- id: "marks",
126- stepNumber: "06",
127- badge: "Karne & Devam",
128- badgeTone: "border-sky-500/40 text-foreground bg-card",
129- borderTone: "border-sky-500/40 dark:border-sky-500/30 hover:border-sky-500/70 ring-1 ring-sky-500/20",
130- icon: IconReportAnalytics,
131- iconColor: "text-sky-400",
132- title: "Karne & İlerleme Raporu",
133- description: "Dönem ders ortalamaları ve sınav türü ağırlıklarına göre hesaplanan genel başarı puanı. Devamsızlık istatistikleri ile anlık gelişim takibi.",
134- to: "/marks",
135- cta: "Karnem",
136- features: ["Ağırlıklı sınav puan ortalaması", "Devamsızlık ve mazeret özetleri", "Detaylı grafik ve ders raporları"],
137- },
138- ];
139 85
140 return (86 return (
141 <div class="space-y-6">87 <div class="space-y-6">
142- <PageHeader88+ <PageHeader eyebrow={t("nav.guide")} title={t("guide.title")} description={t("guide.subtitle")} />
143- eyebrow={t("nav.guide")}
144- title={t("guide.title")}
145- description="Kampüs akışı: Rol yetkileri, modül kullanım adımları ve pratik çalışma ipuçları."
146- />
147 89
148- {/* 1. ROL BAZLI YETKİ HARİTASI (TABS AT THE TOP) */}
149 <section class="data-shell space-y-4 border-sky-500/15 bg-sky-500/2.5 p-6">90 <section class="data-shell space-y-4 border-sky-500/15 bg-sky-500/2.5 p-6">
150 <div>91 <div>
151- <h2 class="text-lg font-semibold tracking-tight">Rol Bazlı Yetki Haritası</h2>92+ <h2 class="text-lg font-semibold tracking-tight">{t("guide.roles.title")}</h2>
152- <p class="mt-1 text-xs text-muted-foreground">Platformdaki her bir rolün erişebildiği ve yönetebildiği alanlar.</p>93+ <p class="mt-1 text-xs text-muted-foreground">{t("guide.roles.subtitle")}</p>
153 </div>94 </div>
154 95
155 <Tabs defaultValue="student" class="w-full">96 <Tabs defaultValue="student" class="w-full">
156 <TabsList class="w-full justify-start">97 <TabsList class="w-full justify-start">
157- <TabsTrigger value="student" class="flex-row items-center gap-2">98+ <For each={ROLE_TABS}>
158- <IconSchool class="h-4 w-4 shrink-0" />99+ {(role) => (
159- <span class="whitespace-nowrap">Öğrenci</span>100+ <TabsTrigger value={role.id} class="flex-row items-center gap-2">
160- </TabsTrigger>101+ <role.icon class="h-4 w-4 shrink-0" />
161- <TabsTrigger value="teacher" class="flex-row items-center gap-2">102+ <span class="whitespace-nowrap">{t(role.tabKey)}</span>
162- <IconClipboardCheck class="h-4 w-4 shrink-0" />103+ </TabsTrigger>
163- <span class="whitespace-nowrap">Öğretmen</span>104+ )}
164- </TabsTrigger>105+ </For>
165- <TabsTrigger value="parent" class="flex-row items-center gap-2">
166- <IconUsers class="h-4 w-4 shrink-0" />
167- <span class="whitespace-nowrap">Veli</span>
168- </TabsTrigger>
169- <TabsTrigger value="admin" class="flex-row items-center gap-2">
170- <IconUserCog class="h-4 w-4 shrink-0" />
171- <span class="whitespace-nowrap">Yönetici & Admin</span>
172- </TabsTrigger>
173 </TabsList>106 </TabsList>
174 107
175- <TabsContent value="student" class="space-y-3">108+ <For each={ROLE_TABS}>
176- <div class="rounded-xl border border-border/80 bg-card p-4 shadow-xs">109+ {(role) => (
177- <h3 class="text-sm font-semibold text-foreground">Öğrenci Çalışma & Katılım Araçları</h3>110+ <TabsContent value={role.id} class="space-y-3">
178- <ul class="mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2">111+ <div class="rounded-lg border border-border/80 bg-card p-4 shadow-xs">
179- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">112+ <h3 class="text-sm font-semibold text-foreground">
180- <IconCheck class="h-4 w-4 text-emerald-400 shrink-0" />113+ {t(`guide.roles.${role.id}.heading` as MessageKey)}
181- <span>Kendi özel defterinde not tutma, PDF aktarma ve çizim yapma</span>114+ </h3>
182- </li>115+ <ul class="mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2">
183- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">116+ <For each={ITEM_INDEXES}>
184- <IconCheck class="h-4 w-4 text-emerald-400 shrink-0" />117+ {(n) => (
185- <span>Soru havuzunda soru sorma, diğer sorulara çözüm yazma</span>118+ <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
186- </li>119+ <IconCheck class={cn("h-4 w-4 shrink-0", role.checkColor)} />
187- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">120+ <span>{t(`guide.roles.${role.id}.i${n}` as MessageKey)}</span>
188- <IconCheck class="h-4 w-4 text-emerald-400 shrink-0" />121+ </li>
189- <span>Kaydolunan derslerin sınav odasına girme ve süreli sınav çözme</span>122+ )}
190- </li>123+ </For>
191- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">124+ </ul>
192- <IconCheck class="h-4 w-4 text-emerald-400 shrink-0" />125+ </div>
193- <span>Kendi karne ortalamasını ve devamsızlık durumunu izleme</span>126+ </TabsContent>
194- </li>127+ )}
195- </ul>128+ </For>
196- </div>
197- </TabsContent>
198-
199- <TabsContent value="teacher" class="space-y-3">
200- <div class="rounded-xl border border-border/80 bg-card p-4 shadow-xs">
201- <h3 class="text-sm font-semibold text-foreground">Öğretmen Yönetim & Eğitici Paneli</h3>
202- <ul class="mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2">
203- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
204- <IconCheck class="h-4 w-4 text-sky-400 shrink-0" />
205- <span>Ders, etüt ve kulüp oluşturma, öğrencileri derse kaydetme</span>
206- </li>
207- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
208- <IconCheck class="h-4 w-4 text-sky-400 shrink-0" />
209- <span>Ders oturumlarında öğrenci yoklaması alma (Var, Yok, Geç, Mazeretli)</span>
210- </li>
211- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
212- <IconCheck class="h-4 w-4 text-sky-400 shrink-0" />
213- <span>Sınav oluşturma, sorular ekleme ve canlı sınav takibi yürütme</span>
214- </li>
215- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
216- <IconCheck class="h-4 w-4 text-sky-400 shrink-0" />
217- <span>Öğrenci sınav kağıtlarını inceleme, puan verme ve karne onaylama</span>
218- </li>
219- </ul>
220- </div>
221- </TabsContent>
222-
223- <TabsContent value="parent" class="space-y-3">
224- <div class="rounded-xl border border-border/80 bg-card p-4 shadow-xs">
225- <h3 class="text-sm font-semibold text-foreground">Veli Takip & Bilgilendirme Portalı</h3>
226- <ul class="mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2">
227- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
228- <IconCheck class="h-4 w-4 text-violet-400 shrink-0" />
229- <span>Bağlı öğrencilerin ders devamsızlık kayıtlarını anlık izleme</span>
230- </li>
231- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
232- <IconCheck class="h-4 w-4 text-violet-400 shrink-0" />
233- <span>Öğrencinin ders bazlı karne başarı ortalamalarını görüntüleme</span>
234- </li>
235- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
236- <IconCheck class="h-4 w-4 text-violet-400 shrink-0" />
237- <span>Yaklaşan sınav ve etkinlik takvimini takip etme</span>
238- </li>
239- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
240- <IconCheck class="h-4 w-4 text-violet-400 shrink-0" />
241- <span>Öğretmenler ve okul yönetimi ile doğrudan mesajlaşma</span>
242- </li>
243- </ul>
244- </div>
245- </TabsContent>
246-
247- <TabsContent value="admin" class="space-y-3">
248- <div class="rounded-xl border border-border/80 bg-card p-4 shadow-xs">
249- <h3 class="text-sm font-semibold text-foreground">Yönetici & Sistem Politikaları Paneli</h3>
250- <ul class="mt-3 grid gap-2 text-xs text-muted-foreground sm:grid-cols-2">
251- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
252- <IconCheck class="h-4 w-4 text-amber-400 shrink-0" />
253- <span>Kullanıcı hesapları oluşturma, rollerini atama (Öğrenci, Öğretmen, Veli)</span>
254- </li>
255- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
256- <IconCheck class="h-4 w-4 text-amber-400 shrink-0" />
257- <span>Okul akademik dönemleri, sınav türleri ve ağırlık oranlarını tanımlama</span>
258- </li>
259- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
260- <IconCheck class="h-4 w-4 text-amber-400 shrink-0" />
261- <span>Tüm ders ve etkinlik kayıtlarını genel denetim seviyesinde yönetme</span>
262- </li>
263- <li class="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 p-2.5">
264- <IconCheck class="h-4 w-4 text-amber-400 shrink-0" />
265- <span>Personel çalışma günlüklerini ve sistem loglarını inceleme</span>
266- </li>
267- </ul>
268- </div>
269- </TabsContent>
270 </Tabs>129 </Tabs>
271 </section>130 </section>
272 131
273- {/* 2. TEMEL AKIŞLAR & ÖZELLİKLER (MODÜL KARTLARI) */}
274 <section class="data-shell space-y-6 border-sky-500/15 bg-sky-500/2.5 p-6">132 <section class="data-shell space-y-6 border-sky-500/15 bg-sky-500/2.5 p-6">
275 <div>133 <div>
276- <h2 class="text-lg font-semibold tracking-tight">Temel Akışlar & Özellikler</h2>134+ <h2 class="text-lg font-semibold tracking-tight">{t("guide.modules.title")}</h2>
277- <p class="mt-1 text-xs text-muted-foreground">Hezarfen platformundaki ana modülleri ve kullanım adımlarını inceleyin.</p>135+ <p class="mt-1 text-xs text-muted-foreground">{t("guide.modules.subtitle")}</p>
278 </div>136 </div>
279 137
280 <div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">138 <div class="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
281- <For each={steps}>139+ <For each={STEPS}>
282 {(step) => (140 {(step) => (
283- <article class={cn("group relative flex flex-col justify-between overflow-hidden rounded-lg border bg-card p-5 shadow-xs transition-all duration-200 ease-out hover:-translate-y-1 hover:shadow-md", step.borderTone)}>141+ <article
142+ class={cn(
143+ "group relative flex flex-col justify-between overflow-hidden rounded-lg border bg-card p-5 shadow-xs transition-all duration-200 ease-out hover:-translate-y-1 hover:shadow-md",
144+ step.borderTone,
145+ )}
146+ >
284 <div class="space-y-3">147 <div class="space-y-3">
285 <div class="flex items-center justify-between gap-2">148 <div class="flex items-center justify-between gap-2">
286- <span class={cn("inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-[11px] font-bold uppercase tracking-wider", step.badgeTone)}>149+ <span
150+ class={cn(
151+ "inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1 text-[11px] font-bold uppercase tracking-wider",
152+ BADGE_TONE,
153+ )}
154+ >
287 <step.icon class="h-3.5 w-3.5" />155 <step.icon class="h-3.5 w-3.5" />
288- {step.badge}156+ {stepText(step.id, "badge")}
289 </span>157 </span>
290 <span class="mono text-xs font-bold opacity-40">{step.stepNumber}</span>158 <span class="mono text-xs font-bold opacity-40">{step.stepNumber}</span>
291 </div>159 </div>
292 160
293- <h3 class="text-base font-semibold tracking-tight text-foreground">{step.title}</h3>161+ <h3 class="text-base font-semibold tracking-tight text-foreground">{stepText(step.id, "title")}</h3>
294- <p class="text-xs leading-relaxed text-muted-foreground">{step.description}</p>162+ <p class="text-xs leading-relaxed text-muted-foreground">{stepText(step.id, "description")}</p>
295 163
296 <ul class="space-y-1.5 pt-2">164 <ul class="space-y-1.5 pt-2">
297- <For each={step.features}>165+ <For each={[1, 2, 3] as const}>
298- {(feat) => (166+ {(n) => (
299 <li class="flex items-center gap-2 text-[11px] text-muted-foreground">167 <li class="flex items-center gap-2 text-[11px] text-muted-foreground">
300 <IconCheck class={cn("h-3.5 w-3.5 shrink-0", step.iconColor)} />168 <IconCheck class={cn("h-3.5 w-3.5 shrink-0", step.iconColor)} />
301- <span>{feat}</span>169+ <span>{stepText(step.id, `f${n}`)}</span>
302 </li>170 </li>
303 )}171 )}
304 </For>172 </For>
305 </ul>173 </ul>
306 </div>174 </div>
307 175
308- <div class="mt-5 pt-3 border-t border-border/60">176+ <div class="mt-5 border-t border-border/60 pt-3">
309 <Link to={step.to}>177 <Link to={step.to}>
310- <Button variant="default" size="sm" class="w-full justify-between rounded-xl text-xs">178+ <Button variant="default" size="sm" class="w-full justify-between rounded-lg text-xs">
311- <span>{step.cta}</span>179+ <span>{stepText(step.id, "cta")}</span>
312 <span class="font-bold">→</span>180 <span class="font-bold">→</span>
313 </Button>181 </Button>
314 </Link>182 </Link>
@@ -319,50 +187,31 @@ function GuideContent() {
319 </div>187 </div>
320 </section>188 </section>
321 189
322- {/* 3. PRATİK İPUÇLARI & KISAYOLLAR */}
323 <section class="data-shell space-y-4 border-sky-500/15 bg-sky-500/2.5 p-6">190 <section class="data-shell space-y-4 border-sky-500/15 bg-sky-500/2.5 p-6">
324 <div>191 <div>
325- <h2 class="text-lg font-semibold tracking-tight">Pratik İpuçları & Kısayollar</h2>192+ <h2 class="text-lg font-semibold tracking-tight">{t("guide.tips.title")}</h2>
326- <p class="mt-1 text-xs text-muted-foreground">Hezarfen deneyimini en verimli şekilde kullanmanızı sağlayan püf noktaları.</p>193+ <p class="mt-1 text-xs text-muted-foreground">{t("guide.tips.subtitle")}</p>
327 </div>194 </div>
328 195
329 <ul class="grid gap-3 text-xs text-muted-foreground sm:grid-cols-2">196 <ul class="grid gap-3 text-xs text-muted-foreground sm:grid-cols-2">
330- <li class="flex items-start gap-3 rounded-xl border border-border/60 bg-card p-4 shadow-xs">197+ <For each={TIPS}>
331- <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/80 bg-card text-violet-400">198+ {(tip) => (
332- <IconGlobe class="h-4 w-4" />199+ <li class="flex items-start gap-3 rounded-lg border border-border/60 bg-card p-4 shadow-xs">
333- </span>200+ <span
334- <div>201+ class={cn(
335- <p class="font-semibold text-foreground">Dil & Tema Seçimi</p>202+ "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/80 bg-card",
336- <p class="mt-1 leading-relaxed">Sağ üstteki profil avatarınıza tıklayarak Türkçe / İngilizce dillerini ve Dark / Light temalarını anında değiştirebilirsiniz.</p>203+ tip.tone,
337- </div>204+ )}
338- </li>205+ >
339- <li class="flex items-start gap-3 rounded-xl border border-border/60 bg-card p-4 shadow-xs">206+ <tip.icon class="h-4 w-4" />
340- <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/80 bg-card text-sky-400">207+ </span>
341- <IconClock class="h-4 w-4" />208+ <div>
342- </span>209+ <p class="font-semibold text-foreground">{t(`guide.tips.${tip.id}.title` as MessageKey)}</p>
343- <div>210+ <p class="mt-1 leading-relaxed">{t(`guide.tips.${tip.id}.body` as MessageKey)}</p>
344- <p class="font-semibold text-foreground">Otomatik Senkronizasyon</p>211+ </div>
345- <p class="mt-1 leading-relaxed">Sınav odasındaki yanıtlarınız ve çizim tuvalindeki taslaklarınız sunucu saati (`/time`) ile arka planda güvenle kaydedilir.</p>212+ </li>
346- </div>213+ )}
347- </li>214+ </For>
348- <li class="flex items-start gap-3 rounded-xl border border-border/60 bg-card p-4 shadow-xs">
349- <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/80 bg-card text-amber-400">
350- <IconFileText class="h-4 w-4" />
351- </span>
352- <div>
353- <p class="font-semibold text-foreground">Hızlı Not İçe Aktarma</p>
354- <p class="mt-1 leading-relaxed">Notlar sayfasında "İçe Aktar" butonunu kullanarak PDF ve TXT ders dokümanlarınızı temiz Markdown metinlerine dönüştürebilirsiniz.</p>
355- </div>
356- </li>
357- <li class="flex items-start gap-3 rounded-xl border border-border/60 bg-card p-4 shadow-xs">
358- <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/80 bg-card text-emerald-400">
359- <IconChart class="h-4 w-4" />
360- </span>
361- <div>
362- <p class="font-semibold text-foreground">Ağırlıklı Not Hesaplaması</p>
363- <p class="mt-1 leading-relaxed">Sınav sonuçlarınız, okul yönetiminin tanımladığı sınav türü ağırlıklarına göre doğrudan karne ortalamanıza yansıtılır.</p>
364- </div>
365- </li>
366 </ul>215 </ul>
367 </section>216 </section>
368 </div>217 </div>
src/pages/messages-page.tsxmodified+2 -2
@@ -292,7 +292,7 @@ export default function MessagesPage() {
292 class="h-9 px-3 rounded-full text-xs font-semibold shrink-0"292 class="h-9 px-3 rounded-full text-xs font-semibold shrink-0"
293 onClick={handleRefresh}293 onClick={handleRefresh}
294 disabled={isRefreshing()}294 disabled={isRefreshing()}
295- title="Mesajları Yenile"295+ title={t("messages.refreshList")}
296 >296 >
297 <IconRefresh297 <IconRefresh
298 class={cn(298 class={cn(
@@ -300,7 +300,7 @@ export default function MessagesPage() {
300 isRefreshing() && "animate-spin text-primary"300 isRefreshing() && "animate-spin text-primary"
301 )}301 )}
302 />302 />
303- Yenile303+ {t("common.refresh")}
304 </Button>304 </Button>
305 305
306 <div class="relative w-full">306 <div class="relative w-full">
src/pages/notes-page.tsxmodified+2 -2
@@ -86,14 +86,14 @@ function NotesContent() {
86 </Button>86 </Button>
87 <Button type="button" variant="outline" size="sm" class="min-w-30 rounded-lg" onClick={() => setImportOpen(true)}>87 <Button type="button" variant="outline" size="sm" class="min-w-30 rounded-lg" onClick={() => setImportOpen(true)}>
88 <IconUploadCloud class="h-4 w-4" />88 <IconUploadCloud class="h-4 w-4" />
89- İçe Aktar89+ {t("notes.import")}
90 </Button>90 </Button>
91 </div>91 </div>
92 }92 }
93 />93 />
94 </div>94 </div>
95 95
96- <SidePanel open={importOpen()} onOpenChange={setImportOpen} title="İçe Aktar">96+ <SidePanel open={importOpen()} onOpenChange={setImportOpen} title={t("notes.import")}>
97 <NoteImportPanel97 <NoteImportPanel
98 onCancel={() => setImportOpen(false)}98 onCancel={() => setImportOpen(false)}
99 onImport={async (importedTitle, importedMarkdown) => {99 onImport={async (importedTitle, importedMarkdown) => {
src/pages/questions-page.tsxmodified+1 -1
@@ -186,7 +186,7 @@ function QuestionsContent() {
186 open={!!questionToDelete()}186 open={!!questionToDelete()}
187 onOpenChange={(open) => !open && setQuestionToDelete(null)}187 onOpenChange={(open) => !open && setQuestionToDelete(null)}
188 title={t("common.delete")}188 title={t("common.delete")}
189- summary="Bu soruyu silmek istediğinizden emin misiniz?"189+ summary={t("questions.deleteConfirm")}
190 onConfirm={handleDeleteConfirmed}190 onConfirm={handleDeleteConfirmed}
191 />191 />
192 </div>192 </div>