fix: several toasts and messages stay in English in every language (#35328)

A handful of messages skipped translation: the /model command toasts in chat, "No content" in the file preview, the valves load error, the knowledge file viewer's unsupported file type and empty workbook messages, the archived and deleted chats toasts in the sidebar selection bar, and the row errors in the user CSV import. They now go through translation, reusing existing strings where one already says the same thing.

Fixes #35327
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-30 22:37:54 +04:00
1 parent 6ea7d06322
commit 9aa4ea3787
6 files changed
+13 -11

No files matched your search

@@ -85,7 +85,7 @@
) {
validRows.push({ idx, columns });
} else {
toast.error(`Row ${idx + 1}: invalid format.`);
toast.error($i18n.t('Row {{row}}: invalid format.', { row: idx + 1 }));
}
}
}
@@ -105,7 +105,7 @@
columns[3].toLowerCase(),
generateInitialsImage(columns[0])
).catch((error) => {
toast.error(`Row ${idx + 1}: ${error}`);
toast.error($i18n.t('Row {{row}}: {{error}}', { row: idx + 1, error }));
return null;
})
)
+3 -3
View File
@@ -4495,7 +4495,7 @@
);
toast.message(
currentModels.length
? `Current model: ${currentModels.join(', ')}`
? $i18n.t('Current model: {{models}}', { models: currentModels.join(', ') })
: $i18n.t('Model not selected')
);
messageInput?.setText('');
@@ -4506,7 +4506,7 @@
const model = ($models ?? []).find((model) => model.id === modelId);
if (!model) {
toast.error(`Model not found: ${modelId}`);
toast.error($i18n.t('Model not found: {{modelId}}', { modelId }));
messageInput?.setText('');
prompt = '';
messageInput?.focus({ preventScroll: true });
@@ -4517,7 +4517,7 @@
selectedModels = [model.id];
saveControls(selectedModels);
saveSessionSelectedModels();
toast.success(`Model switched to: ${model.id}`);
toast.success($i18n.t('Model switched to: {{modelId}}', { modelId: model.id }));
messageInput?.setText('');
prompt = '';
messageInput?.focus({ preventScroll: true });
@@ -396,7 +396,7 @@
</div>
{:else if selectedTab === ''}
{#if item?.file?.data}
{@const rawContent = (item?.file?.data?.content ?? '').trim() || 'No content'}
{@const rawContent = (item?.file?.data?.content ?? '').trim() || $i18n.t('No content')}
{@const isTruncated =
($settings?.renderMarkdownInPreviews ?? true) &&
rawContent.length > CONTENT_PREVIEW_LIMIT &&
@@ -426,7 +426,7 @@
</div>
{/if}
{:else if item?.content}
{@const rawContent = (item?.content ?? '').trim() || 'No content'}
{@const rawContent = (item?.content ?? '').trim() || $i18n.t('No content')}
{@const isTruncated =
($settings?.renderMarkdownInPreviews ?? true) &&
rawContent.length > CONTENT_PREVIEW_LIMIT &&
@@ -522,7 +522,7 @@
{/if}
{:else}
<div class="max-h-96 overflow-scroll scrollbar-hidden text-xs whitespace-pre-wrap">
{(item?.file?.data?.content ?? '').trim() || 'No content'}
{(item?.file?.data?.content ?? '').trim() || $i18n.t('No content')}
</div>
{/if}
{/if}
+2
View File
@@ -224,6 +224,8 @@
(selected) => new Set([...selected].filter((id) => !succeeded.has(id)))
);
if (succeeded.size > 0) {
// $i18n.t('{{count}} chats archived.', { count })
// $i18n.t('{{count}} chats deleted.', { count })
toast.success(
$i18n.t(action === 'archive' ? '{{count}} chats archived.' : '{{count}} chats deleted.', {
count: succeeded.size
@@ -127,7 +127,7 @@
const bytes = await blob.arrayBuffer();
if (signal.aborted || key !== request) return;
const workbook = await readExcelWorkbook(bytes);
if (!workbook.SheetNames.length) throw new Error('This workbook has no sheets.');
if (!workbook.SheetNames.length) throw new Error($i18n.t('This workbook has no sheets.'));
selectedExcelSheet = workbook.SheetNames[0];
data = { excelWorkbook: workbook };
} else if (ext === 'pptx' || mime.includes('presentationml')) {
@@ -150,7 +150,7 @@
sourceToggle = /\.(md|markdown|mdx|csv|tsv|json|jsonc|jsonl|json5|html?|svg|ipynb)$/i.test(
previewName
);
} else throw new Error('Preview is not available for this file type.');
} else throw new Error($i18n.t('Preview is not available for this file type.'));
if (signal.aborted || key !== request) return;
previewData = data;
originalLoaded = true;
@@ -149,7 +149,7 @@
loading = false;
} catch (e) {
toast.error(`Error fetching valves`);
toast.error($i18n.t('Failed to load valves'));
show = false;
}
};