forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

rag-copy.ts162 lines, 6.7 KiBHistoryRawDownload
1import type { Locale } from "@/i18n/messages";
2
3/**
4 * The documented abstention codes (`guard_*`, `insufficient_data`,
5 * `model_abstained`, `empty_scope`) in plain words; an unknown code is shown
6 * as it came rather than guessed at.
7 */
8function reasonText(locale: Locale, reason: string): string {
9 const tr = locale === "tr";
10 if (reason === "insufficient_data") return tr ? "ders içeriklerinde bunu yanıtlayacak kadar bilgi yok" : "the course material does not cover this enough";
11 if (reason === "model_abstained") return tr ? "yapay zekâ bunu güvenle yanıtlayamadı" : "the AI could not answer this confidently";
12 if (reason === "empty_scope") return tr ? "çalışılacak bir aralık seçilmedi" : "no range was selected to study";
13 if (reason.startsWith("guard_")) return tr ? "soru içerik kurallarına takıldı" : "the question was stopped by the content rules";
14 return reason;
15}
16
17const copy = {
18 en: {
19 title: "Ask your notes",
20 newThread: "New chat",
21 history: "Chat history",
22 recents: "Recents",
23 collapseHistory: "Hide chat history",
24 expandHistory: "Show chat history",
25 loadMore: "Show more",
26 threadsFailed: "Chats could not be loaded.",
27 tryAgain: "Try again",
28 greetingMorning: "Good morning",
29 greetingAfternoon: "Good afternoon",
30 greetingEvening: "Good evening",
31 openHistory: "Open chat history",
32 closeHistory: "Close chat history",
33 untitled: "Untitled chat",
34 emptyThreads: "No chats yet",
35 emptyThreadsHint: "Start a new chat to ask the course corpus a question.",
36 emptyChat: "What would you like to learn?",
37 emptyChatHint: "Answers use only the course material available to your account.",
38 placeholder: "Ask a question about your course notes…",
39 send: "Send",
40 composerHint: "Enter to send · Shift+Enter for a new line",
41 thinking: "Searching your course material…",
42 thinking2: "Reading the sources…",
43 thinking3: "Preparing the answer…",
44 copy: "Copy",
45 copied: "Copied",
46 retry: "Ask again",
47 scrollToLatest: "Latest",
48 newMessages: "New message",
49 groupToday: "Today",
50 groupYesterday: "Yesterday",
51 groupThisWeek: "This week",
52 groupEarlier: "Earlier",
53 sources: "Sources",
54 source: "Source",
55 subject: "Subject",
56 pages: "Pages",
57 document: "Course document",
58 rename: "Rename chat",
59 actions: "Chat actions",
60 renameHint: "Give this chat a short, recognisable name.",
61 renameLabel: "Chat name",
62 renamePlaceholder: "e.g. Newton's laws",
63 delete: "Delete chat",
64 deleteHint: "This permanently deletes the chat and all of its messages.",
65 deleteConfirm: "Delete chat",
66 failed: "The answer could not be completed. Please try again.",
67 failedWithCode: (code: string) => `The answer could not be completed (${code}). Please try again.`,
68 abstained: "There was not enough course material to answer this question confidently.",
69 abstainedReason: (reason: string) => `Reason: ${reasonText("en", reason)}`,
70 loadingMessages: "Loading messages…",
71 tabLabel: "Study",
72 studyFrom: (ders: string) => `Study these ${ders} passages`,
73 summarize: "Summarize",
74 practice: "Practice questions",
75 difficulty: "Difficulty",
76 difficultyEasy: "Easy",
77 difficultyMedium: "Medium",
78 difficultyHard: "Hard",
79 summaryTitle: "Summary",
80 questionsTitle: "Practice questions",
81 showAnswer: "Show answer",
82 working: "Working on it…",
83 coveredPages: (pages: string) => `Pages covered: ${pages}`,
84 studyUnavailable: "Summaries and practice questions are not available right now; the AI service for them is not connected.",
85 studyFailed: (reason: string) => `This could not be prepared: ${reason}`,
86 noQuestions: "No questions could be drawn from these passages.",
87 },
88 tr: {
89 title: "Notlarına sor",
90 newThread: "Yeni sohbet",
91 history: "Sohbet geçmişi",
92 recents: "Son sohbetler",
93 collapseHistory: "Sohbet geçmişini gizle",
94 expandHistory: "Sohbet geçmişini göster",
95 loadMore: "Daha fazla göster",
96 threadsFailed: "Sohbetler yüklenemedi.",
97 tryAgain: "Tekrar dene",
98 greetingMorning: "Günaydın",
99 greetingAfternoon: "İyi günler",
100 greetingEvening: "İyi akşamlar",
101 openHistory: "Sohbet geçmişini aç",
102 closeHistory: "Sohbet geçmişini kapat",
103 untitled: "Başlıksız sohbet",
104 emptyThreads: "Henüz sohbet yok",
105 emptyThreadsHint: "Ders arşivine soru sormak için yeni bir sohbet başlat.",
106 emptyChat: "Ne öğrenmek istersin?",
107 emptyChatHint: "Yanıtlar yalnızca hesabının erişebildiği ders içeriklerini kullanır.",
108 placeholder: "Ders notların hakkında bir soru sor…",
109 send: "Gönder",
110 composerHint: "Göndermek için Enter · Yeni satır için Shift+Enter",
111 thinking: "Ders içeriklerinde aranıyor…",
112 thinking2: "Kaynaklar taranıyor…",
113 thinking3: "Yanıt hazırlanıyor…",
114 copy: "Kopyala",
115 copied: "Kopyalandı",
116 retry: "Tekrar sor",
117 scrollToLatest: "En son",
118 newMessages: "Yeni mesaj",
119 groupToday: "Bugün",
120 groupYesterday: "Dün",
121 groupThisWeek: "Bu hafta",
122 groupEarlier: "Daha önce",
123 sources: "Kaynaklar",
124 source: "Kaynak",
125 subject: "Ders",
126 pages: "Sayfalar",
127 document: "Ders belgesi",
128 rename: "Sohbeti yeniden adlandır",
129 actions: "Sohbet işlemleri",
130 renameHint: "Bu sohbete kısa ve ayırt edilebilir bir ad ver.",
131 renameLabel: "Sohbet adı",
132 renamePlaceholder: "Örn. Newton yasaları",
133 delete: "Sohbeti sil",
134 deleteHint: "Bu işlem sohbeti ve tüm mesajlarını kalıcı olarak siler.",
135 deleteConfirm: "Sohbeti sil",
136 failed: "Yanıt tamamlanamadı. Lütfen tekrar dene.",
137 failedWithCode: (code: string) => `Yanıt tamamlanamadı (${code}). Lütfen tekrar dene.`,
138 abstained: "Bu soruyu güvenle yanıtlamak için yeterli ders içeriği bulunamadı.",
139 abstainedReason: (reason: string) => `Neden: ${reasonText("tr", reason)}`,
140 loadingMessages: "Mesajlar yükleniyor…",
141 tabLabel: "Çalış",
142 studyFrom: (ders: string) => `Bu ${ders} kaynaklarıyla çalış`,
143 summarize: "Özetle",
144 practice: "Soru üret",
145 difficulty: "Zorluk",
146 difficultyEasy: "Kolay",
147 difficultyMedium: "Orta",
148 difficultyHard: "Zor",
149 summaryTitle: "Özet",
150 questionsTitle: "Pratik sorular",
151 showAnswer: "Cevabı göster",
152 working: "Hazırlanıyor…",
153 coveredPages: (pages: string) => `Kapsanan sayfalar: ${pages}`,
154 studyUnavailable: "Özet ve soru üretimi şu an kullanılamıyor; bunlar için yapay zekâ servisi bağlı değil.",
155 studyFailed: (reason: string) => `Hazırlanamadı: ${reason}`,
156 noQuestions: "Bu kaynaklardan soru çıkarılamadı.",
157 },
158} as const;
159
160export function ragCopy(locale: Locale) {
161 return copy[locale];
162}