forge
Explore
Log in

Don't you dare go Hollow

🌍 route 19 hardcoded Turkish strings through the dictionary

Browse files at this commit

23ef9a89370e3bf019818efea65e1265018c8d23Burak BoduroğluParent: 3660654
  • fix
    • 🌍 route 19 hardcoded Turkish strings through the dictionary
Show full message
fix: 🌍 route 19 hardcoded Turkish strings through the dictionary
- the en dictionary itself was clean; these strings never called t() at
  all, so they stayed Turkish whatever the locale said
- command palette: the theme action described itself in Turkish in both
  locales, and the language action had its two branches swapped — a
  Turkish user read "Switch to English", an English user read "Türkçe
  diline geç". Its footer key hints were Turkish too
- messages: "Yanıtla" x3, "Yanıtla:", "Çöp Kutusundan Çıkar" x2, the
  read/unread and expand/minimise titles, and four toasts — refresh,
  the permanent-delete guard, the read-state guard, and empty-trash
- rich-text-editor's toolbar labels and body placeholder, plus
  data-table-search's default "Ara" — both shared, so every table and
  every note/message editor picked the fix up at once
- 18 new keys in both locales; reuse messages.reply,
  messages.restoreFromTrash, messages.markAsRead/Unread, common.search
  where a key already said the same thing
- left alone: celebi-panel, date-picker, calendar-page and the app.tsx
  error screen already branch on locale(), and the palette's Turkish
  keywords are search aids that never render
src/components/layout/command-palette.tsxmodified+5 -5
@@ -225,7 +225,7 @@ export function CommandPalette(props: CommandPaletteProps) {
225225 category: "system",
226226 categoryLabel: systemCategoryLabel,
227227 title: isDark ? t("command.action.themeLight") : t("command.action.themeDark"),
228- description: isDark ? "Açık moda geç" : "Koyu moda geç",
228+ description: isDark ? t("command.action.themeLightDesc") : t("command.action.themeDarkDesc"),
229229 keywords: "theme tema koyu acik dark light mode",
230230 icon: isDark ? IconSun : IconMoon,
231231 onSelect: () => prefs.setTheme(isDark ? "light" : "dark"),
@@ -237,7 +237,7 @@ export function CommandPalette(props: CommandPaletteProps) {
237237 category: "system",
238238 categoryLabel: systemCategoryLabel,
239239 title: isTr ? t("command.action.langEn") : t("command.action.langTr"),
240- description: isTr ? "Switch to English" : "Türkçe diline geç",
240+ description: isTr ? t("command.action.langEnDesc") : t("command.action.langTrDesc"),
241241 keywords: "language dil turkce english tr en",
242242 icon: IconGlobe,
243243 onSelect: () => prefs.setLocale(isTr ? "en" : "tr"),
@@ -466,11 +466,11 @@ export function CommandPalette(props: CommandPaletteProps) {
466466 <span class="truncate">{t("command.shortcutHint")}</span>
467467 <div class="flex items-center gap-2 font-mono shrink-0">
468468 <kbd class="rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-semibold">↑↓</kbd>
469- <span>navigasyon</span>
469+ <span>{t("command.key.navigate")}</span>
470470 <kbd class="rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-semibold">↵</kbd>
471- <span>seç</span>
471+ <span>{t("command.key.select")}</span>
472472 <kbd class="rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-semibold">Esc</kbd>
473- <span>kapat</span>
473+ <span>{t("command.key.close")}</span>
474474 </div>
475475 </div>
476476 </DialogContent>
src/components/messages/gmail-compose-box.tsxmodified+1 -1
@@ -97,7 +97,7 @@ export function GmailComposeBox(props: GmailComposeBoxProps) {
9797 type="button"
9898 class="flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground hover:bg-muted hover:text-foreground"
9999 onClick={() => setIsMinimized(!isMinimized())}
100- title={isMinimized() ? "Genişlet" : "Simge durumuna küçült"}
100+ title={isMinimized() ? t("messages.expand") : t("messages.minimize")}
101101 >
102102 <span class="text-xs font-bold">{isMinimized() ? "□" : "—"}</span>
103103 </button>
src/components/messages/gmail-mail-detail.tsxmodified+4 -4
@@ -181,7 +181,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
181181 title={t("messages.restoreFromTrash")}
182182 >
183183 <IconMessage class="mr-1.5 h-3.5 w-3.5" />
184- Çöp Kutusundan Çıkar
184+ {t("messages.restoreFromTrash")}
185185 </Button>
186186 </Show>
187187
@@ -267,7 +267,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
267267 onClick={handleStartReply}
268268 >
269269 <IconMessage class="mr-1.5 h-3.5 w-3.5" />
270- Yanıtla
270+ {t("messages.reply")}
271271 </Button>
272272 </Show>
273273 </div>
@@ -291,7 +291,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
291291 onClick={handleStartReply}
292292 >
293293 <IconMessage class="mr-2 h-4 w-4" />
294- Yanıtla
294+ {t("messages.reply")}
295295 </Button>
296296 </div>
297297 }
@@ -303,7 +303,7 @@ export function GmailMailDetail(props: GmailMailDetailProps) {
303303 >
304304 <div class="flex items-center justify-between text-xs border-b pb-2">
305305 <div class="flex items-center gap-2">
306- <span class="font-bold text-foreground">Yanıtla:</span>
306+ <span class="font-bold text-foreground">{t("messages.replyTo")}</span>
307307 <Badge variant="secondary" class="text-xs font-medium">
308308 {peerName()}
309309 </Badge>
src/components/messages/gmail-mail-row.tsxmodified+2 -2
@@ -116,7 +116,7 @@ export function GmailMailRow(props: GmailMailRowProps) {
116116 <button
117117 type="button"
118118 class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors"
119- title={props.folder === "trash" ? "Çöp Kutusundan Çıkar" : t("messages.moveToTrash")}
119+ title={props.folder === "trash" ? t("messages.restoreFromTrash") : t("messages.moveToTrash")}
120120 onClick={(e) => {
121121 e.stopPropagation();
122122 props.onTrash?.();
@@ -144,7 +144,7 @@ export function GmailMailRow(props: GmailMailRowProps) {
144144 <button
145145 type="button"
146146 class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors"
147- title={unread() ? "Okundu olarak işaretle" : "Okunmadı olarak işaretle"}
147+ title={unread() ? t("messages.markAsRead") : t("messages.markAsUnread")}
148148 onClick={(e) => {
149149 e.stopPropagation();
150150 props.onToggleRead?.();
src/components/ui/data-table-search.tsxmodified+1 -1
@@ -20,7 +20,7 @@ export function DataTableSearch(props: DataTableSearchProps) {
2020 <Input
2121 value={props.value}
2222 onInput={(event) => props.onChange(event.currentTarget.value)}
23- placeholder={props.placeholder ?? "Ara"}
23+ placeholder={props.placeholder ?? t("common.search")}
2424 class={cn("h-8 rounded-lg bg-muted/40 text-[13px] md:text-[13px]", props.value ? "pl-9 pr-8" : "pl-9")}
2525 />
2626 <Show when={props.value}>
src/components/ui/rich-text-editor.tsxmodified+4 -4
@@ -97,7 +97,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
9797 onClick={() => execCommand("insertUnorderedList")}
9898 title={t("editor.bulletList")}
9999 >
100- • Liste
100+ • {t("editor.bulletListLabel")}
101101 </button>
102102 <button
103103 type="button"
@@ -105,7 +105,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
105105 onClick={() => execCommand("insertOrderedList")}
106106 title={t("editor.numberedList")}
107107 >
108- 1. Liste
108+ {t("editor.numberedListLabel")}
109109 </button>
110110
111111 <div class="mx-1 h-4 w-px bg-border" />
@@ -116,7 +116,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
116116 onClick={() => execCommand("removeFormat")}
117117 title={t("editor.clearFormatting")}
118118 >
119- Biçimi Temizle
119+ {t("editor.clearFormattingLabel")}
120120 </button>
121121 </div>
122122
@@ -136,7 +136,7 @@ export function RichTextEditor(props: RichTextEditorProps) {
136136 {/* Placeholder overlay */}
137137 {!props.value && !isFocused() && (
138138 <div class="pointer-events-none absolute left-3 top-3 text-xs text-muted-foreground/60 select-none">
139- {props.placeholder || "Mesajınızı buraya yazın..."}
139+ {props.placeholder || t("editor.bodyPlaceholder")}
140140 </div>
141141 )}
142142 </div>
src/i18n/messages.tsmodified+54 -0
@@ -131,6 +131,10 @@ export type MessageKey =
131131 | "editor.bulletList"
132132 | "editor.numberedList"
133133 | "editor.clearFormatting"
134+ | "editor.bulletListLabel"
135+ | "editor.numberedListLabel"
136+ | "editor.clearFormattingLabel"
137+ | "editor.bodyPlaceholder"
134138 | "messages.refreshList"
135139 | "messages.deleteDraft"
136140 | "messages.restoreFromTrash"
@@ -412,7 +416,14 @@ export type MessageKey =
412416 | "command.action.langEn"
413417 | "command.action.logout"
414418 | "command.action.logoutDesc"
419+ | "command.action.themeDarkDesc"
420+ | "command.action.themeLightDesc"
421+ | "command.action.langTrDesc"
422+ | "command.action.langEnDesc"
415423 | "command.shortcutHint"
424+ | "command.key.navigate"
425+ | "command.key.select"
426+ | "command.key.close"
416427 | "dashboard.observationOnly"
417428 | "dashboard.today"
418429 | "dashboard.reportCard"
@@ -1419,6 +1430,13 @@ export type MessageKey =
14191430 | "messages.markAsRead"
14201431 | "messages.markAsUnread"
14211432 | "messages.selectRecipient"
1433+ | "messages.expand"
1434+ | "messages.minimize"
1435+ | "messages.replyTo"
1436+ | "messages.refreshedToast"
1437+ | "messages.deleteForeverOnlyTrash"
1438+ | "messages.readOnlyReceived"
1439+ | "messages.trashEmptiedToast"
14221440 | "calendar.title"
14231441 | "calendar.today"
14241442 | "calendar.noEvents"
@@ -1636,6 +1654,10 @@ const en: Dict = {
16361654 "editor.bulletList": "Bulleted list",
16371655 "editor.numberedList": "Numbered list",
16381656 "editor.clearFormatting": "Clear formatting",
1657+ "editor.bulletListLabel": "List",
1658+ "editor.numberedListLabel": "1. List",
1659+ "editor.clearFormattingLabel": "Clear format",
1660+ "editor.bodyPlaceholder": "Write your message here…",
16391661 "messages.refreshList": "Refresh messages",
16401662 "messages.deleteDraft": "Delete draft",
16411663 "messages.restoreFromTrash": "Restore from trash",
@@ -1920,6 +1942,13 @@ const en: Dict = {
19201942 "command.action.logout": "Log out",
19211943 "command.action.logoutDesc": "Sign out of your account",
19221944 "command.shortcutHint": "Use arrow keys to navigate, press Enter to select",
1945+ "command.key.navigate": "navigate",
1946+ "command.key.select": "select",
1947+ "command.key.close": "close",
1948+ "command.action.themeDarkDesc": "Switch to dark mode",
1949+ "command.action.themeLightDesc": "Switch to light mode",
1950+ "command.action.langTrDesc": "Switch to Turkish",
1951+ "command.action.langEnDesc": "Switch to English",
19231952 "dashboard.observationOnly": "Read-only overview of what needs attention.",
19241953 "dashboard.today": "Today",
19251954 "dashboard.reportCard": "Report card",
@@ -3013,6 +3042,13 @@ const en: Dict = {
30133042 "messages.markAsRead": "Mark as read",
30143043 "messages.markAsUnread": "Mark as unread",
30153044 "messages.selectRecipient": "Please select a recipient.",
3045+ "messages.expand": "Expand",
3046+ "messages.minimize": "Minimise",
3047+ "messages.replyTo": "Reply to:",
3048+ "messages.refreshedToast": "Messages refreshed.",
3049+ "messages.deleteForeverOnlyTrash": "Permanent delete only applies to messages in the trash.",
3050+ "messages.readOnlyReceived": "Only received messages can be marked read or unread.",
3051+ "messages.trashEmptiedToast": "Trash emptied.",
30163052 };
30173053
30183054 const tr: Dict = {
@@ -3149,6 +3185,10 @@ const tr: Dict = {
31493185 "editor.bulletList": "Madde işaretli liste",
31503186 "editor.numberedList": "Numaralı liste",
31513187 "editor.clearFormatting": "Biçimlendirmeyi temizle",
3188+ "editor.bulletListLabel": "Liste",
3189+ "editor.numberedListLabel": "1. Liste",
3190+ "editor.clearFormattingLabel": "Biçimi temizle",
3191+ "editor.bodyPlaceholder": "Mesajınızı buraya yazın…",
31523192 "messages.refreshList": "Mesajları yenile",
31533193 "messages.deleteDraft": "Taslağı sil",
31543194 "messages.restoreFromTrash": "Çöp kutusundan çıkar",
@@ -3433,6 +3473,13 @@ const tr: Dict = {
34333473 "command.action.logout": "Oturumu kapat",
34343474 "command.action.logoutDesc": "Mevcut oturumu sonlandır",
34353475 "command.shortcutHint": "Yön tuşlarıyla gezinebilir, Enter ile seçebilirsiniz",
3476+ "command.key.navigate": "gezin",
3477+ "command.key.select": "seç",
3478+ "command.key.close": "kapat",
3479+ "command.action.themeDarkDesc": "Koyu moda geç",
3480+ "command.action.themeLightDesc": "Açık moda geç",
3481+ "command.action.langTrDesc": "Türkçe diline geç",
3482+ "command.action.langEnDesc": "İngilizce diline geç",
34363483 "dashboard.observationOnly": "Dikkat isteyenlerin salt okunur özeti.",
34373484 "dashboard.today": "Bugün",
34383485 "dashboard.reportCard": "Karne",
@@ -4526,6 +4573,13 @@ const tr: Dict = {
45264573 "messages.markAsRead": "Okundu olarak işaretle",
45274574 "messages.markAsUnread": "Okunmadı olarak işaretle",
45284575 "messages.selectRecipient": "Lütfen bir alıcı seçin.",
4576+ "messages.expand": "Genişlet",
4577+ "messages.minimize": "Simge durumuna küçült",
4578+ "messages.replyTo": "Yanıtla:",
4579+ "messages.refreshedToast": "Mesajlar güncellendi.",
4580+ "messages.deleteForeverOnlyTrash": "Kalıcı silme yalnızca çöp kutusundaki mesajlar için geçerli.",
4581+ "messages.readOnlyReceived": "Yalnızca gelen mesajların okundu durumu değiştirilebilir.",
4582+ "messages.trashEmptiedToast": "Çöp kutusu boşaltıldı.",
45294583 };
45304584
45314585 export const messages: Record<Locale, Dict> = { en, tr };
src/pages/messages-page.tsxmodified+4 -4
@@ -102,7 +102,7 @@ export default function MessagesPage() {
102102 setIsRefreshing(true);
103103 try {
104104 await Promise.all([refetch(), refetchUnread()]);
105- setFlash("Mesajlar güncellendi");
105+ setFlash(t("messages.refreshedToast"));
106106 } catch (err: any) {
107107 console.error("Refresh error:", err);
108108 setFlash(formatApiError(err));
@@ -118,7 +118,7 @@ export default function MessagesPage() {
118118 try {
119119 if (action.delete) {
120120 if (msg.folder !== "trash") {
121- setFlash("Kalıcı silme işlemi sadece Çöp Kutusu'ndaki mesajlar için geçerlidir");
121+ setFlash(t("messages.deleteForeverOnlyTrash"));
122122 return;
123123 }
124124 await deleteMessageById(msg.id);
@@ -128,7 +128,7 @@ export default function MessagesPage() {
128128 setFlash(t("messages.movedToast"));
129129 } else if (action.read !== undefined) {
130130 if (isOwnSentMessage(msg)) {
131- setFlash("Sadece alınan mesajların okundu durumu değiştirilebilir");
131+ setFlash(t("messages.readOnlyReceived"));
132132 return;
133133 }
134134 await patchMessageById(msg.id, { read: action.read });
@@ -152,7 +152,7 @@ export default function MessagesPage() {
152152 if (trashItems.length === 0) return;
153153 try {
154154 await Promise.all(trashItems.map((m) => deleteMessageById(m.id)));
155- setFlash("Çöp kutusu boşaltıldı");
155+ setFlash(t("messages.trashEmptiedToast"));
156156 setSelectedId("");
157157 refetch();
158158 } catch (err: any) {