fix: md 预览代码块复制按钮跟随 DSH i18n(MarkdownText 补传 codeLabels)

This commit is contained in:
Menghuan1918
2026-08-13 10:26:57 +08:00
parent 2e9db44a71
commit b31a9a601f
4 changed files with 88 additions and 2 deletions
+9 -1
View File
@@ -329,7 +329,15 @@ export function TextEditor(props: FileViewerProps) {
onMouseUp={handlePreviewMouseUp}
onScroll={hidePopup}
>
<MarkdownText text={draft ?? content ?? ''} />
{/* The fence copy-button labels must come from this plugin's own
dictionary: the DSH MarkdownText/CodeBlock are cordis-free and
fall back to hardcoded Chinese otherwise (same pattern as the
chat's AssistantMarkdown). Render-time t() keeps them following
the active locale on live switches. */}
<MarkdownText
text={draft ?? content ?? ''}
codeLabels={{ copyLabel: t('copy'), copiedLabel: t('copied') }}
/>
</div>
)}
{html && mode === 'preview' && (