feat: 搜索/替换面板中文化 + 复选框/关闭按钮样式优化

- 搜索/替换面板所有按钮和标签翻译为中文(查找、替换、下一个、上一个、全部、区分大小写、正则、全字匹配、全部替换、关闭)
- 复选框从16px增大到18px,优化与文字的水平对齐(inline-flex + align-items: center)
- 修复关闭按钮CSS选择器错误(.cm-close → [name="close"]),图标从16px增大到22px
This commit is contained in:
thzxx
2026-05-28 11:39:48 +08:00
parent ddbe814238
commit a897c47704
2 changed files with 74 additions and 25 deletions
@@ -23,7 +23,23 @@ export function useCodeMirror({ content, onChange, darkMode, onScroll }: UseCode
useEffect(() => {
if (!containerRef.current) return
// 中文本地化(搜索/替换面板)
const zhPhrases = EditorState.phrases.of({
'Find': '查找',
'Replace': '替换',
'next': '下一个',
'previous': '上一个',
'all': '全部',
'match case': '区分大小写',
'regexp': '正则',
'by word': '全字匹配',
'replace': '替换',
'replace all': '全部替换',
'close': '关闭',
})
const extensions: Extension[] = [
zhPhrases,
lineNumbers(),
highlightActiveLine(),
highlightSpecialChars(),