♻️ Refactor and clean up the code

This commit is contained in:
2025-06-22 21:30:45 +08:00
parent eb9b037f8e
commit d6dd34db87
22 changed files with 357 additions and 843 deletions

View File

@@ -11,70 +11,19 @@ export default {
characters: 'Ch',
selected: 'Sel'
},
fontSize: 'Font Size',
fontSizeTooltip: 'Font Size (Ctrl+wheel to adjust)',
tabLabel: 'Tab',
tabType: {
spaces: 'Spaces',
tab: 'Tab'
},
encoding: 'UTF-8',
settings: 'Settings',
alwaysOnTop: 'Always on Top',
blockLanguage: 'Block Language',
searchLanguage: 'Search language...',
noLanguageFound: 'No language found',
autoDetected: 'Auto-detected',
formatHint: 'Current block supports formatting, use Ctrl+Shift+F shortcut for formatting',
},
config: {
loadSuccess: 'Configuration loaded successfully',
loadFailed: 'Failed to load configuration',
saveSuccess: 'Configuration saved',
saveFailed: 'Failed to save configuration',
resetSuccess: 'Configuration reset to defaults',
resetFailed: 'Failed to reset configuration',
fontSizeFixed: 'Font size ({value}) has been corrected to {fixed}',
tabSizeFixed: 'Tab size ({value}) has been corrected to {fixed}',
tabTypeFixed: 'Tab type ({value}) is invalid, corrected to spaces',
alwaysOnTopFailed: 'Failed to set window always on top',
alwaysOnTopSuccess: 'Window always on top status updated',
languageChanged: 'Language setting updated',
languageChangeFailed: 'Failed to update language setting',
themeChanged: 'Theme setting updated',
themeChangeFailed: 'Failed to update theme setting',
systemThemeChanged: 'System theme setting updated',
systemThemeChangeFailed: 'Failed to update system theme setting',
startupSuccess: 'Startup setting updated',
startupFailed: 'Failed to update startup setting'
},
languages: {
'zh-CN': '简体中文',
'en-US': 'English'
},
systemTheme: {
dark: 'Dark',
light: 'Light',
auto: 'Follow System'
},
document: {
loadSuccess: 'Document loaded successfully',
loadFailed: 'Failed to load document',
saveSuccess: 'Document saved successfully',
saveFailed: 'Failed to save document',
manualSaveSuccess: 'Manually saved successfully',
settings: {
loadFailed: 'Failed to load save settings',
saveSuccess: 'Save settings updated',
saveFailed: 'Failed to update save settings'
},
},
migration: {
started: 'Starting data migration',
migrating: 'Migrating',
completed: 'Migration Completed',
failed: 'Migration Failed'
},
keybindings: {
headers: {
shortcut: 'Shortcut',
@@ -88,10 +37,7 @@ export default {
searchToggleWord: 'Toggle whole word matching',
searchToggleRegex: 'Toggle regular expression matching',
searchShowReplace: 'Show replace functionality',
searchFindNext: 'Find next match',
searchFindPrev: 'Find previous match',
searchReplaceAll: 'Replace all matches',
searchSelectAll: 'Select all content',
blockSelectAll: 'Select all in block',
blockAddAfterCurrent: 'Add new block after current',
blockAddAfterLast: 'Add new block at end',
@@ -125,7 +71,6 @@ export default {
selectSyntaxRight: 'Select syntax right',
copyLineUp: 'Copy line up',
copyLineDown: 'Copy line down',
simplifySelection: 'Simplify selection',
insertBlankLine: 'Insert blank line',
selectLine: 'Select line',
selectParentSyntax: 'Select parent syntax',
@@ -151,10 +96,7 @@ export default {
appearance: 'Appearance',
keyBindings: 'Key Bindings',
updates: 'Updates',
comingSoon: 'Coming Soon...',
save: 'Save',
reset: 'Reset',
cancel: 'Cancel',
dangerZone: 'Danger Zone',
resetAllSettings: 'Reset All Settings',
confirmReset: 'Click again to confirm reset',
@@ -171,7 +113,6 @@ export default {
clickToSelectPath: 'Click to select path',
resetDefault: 'Reset Default',
resetToDefaultPath: 'Reset to default path',
restartRequiredForDataPath: 'Restart required',
fontSize: 'Font Size',
fontSizeDescription: 'Editor font size',
fontSettings: 'Font Settings',
@@ -189,15 +130,7 @@ export default {
enableTabIndent: 'Enable Tab Indent',
language: 'Interface Language',
systemTheme: 'System Theme',
theme: 'Editor Theme',
themeDescription: 'Choose editor theme',
restartRequired: '(Restart required)',
saveOptions: 'Save Options',
autoSaveDelay: 'Auto Save Delay (ms)',
selectDirectoryFailed: 'Failed to select directory',
validation: {
customPathRequired: 'A valid directory must be selected when enabling custom path',
customPathAutoDisabled: 'Custom data path has been automatically disabled due to no valid directory selected'
}
autoSaveDelay: 'Auto Save Delay (ms)'
}
};

View File

@@ -11,70 +11,19 @@ export default {
characters: 'Ch',
selected: 'Sel'
},
fontSize: '字体大小',
fontSizeTooltip: '字体大小 (Ctrl+滚轮调整)',
tabLabel: 'Tab',
tabType: {
spaces: '空格',
tab: '制表符'
},
encoding: 'UTF-8',
settings: '设置',
alwaysOnTop: '窗口置顶',
blockLanguage: '块语言',
searchLanguage: '搜索语言...',
noLanguageFound: '未找到匹配的语言',
autoDetected: '自动检测',
formatHint: '当前区块支持格式化,使用 Ctrl+Shift+F 进行格式化',
},
config: {
loadSuccess: '配置加载成功',
loadFailed: '配置加载失败',
saveSuccess: '配置已保存',
saveFailed: '配置保存失败',
resetSuccess: '配置已重置为默认值',
resetFailed: '重置配置失败',
fontSizeFixed: '字体大小值({value})已被修正为{fixed}',
tabSizeFixed: 'Tab大小值({value})已被修正为{fixed}',
tabTypeFixed: 'Tab类型({value})不合法,已修正为空格',
alwaysOnTopFailed: '无法设置窗口置顶状态',
alwaysOnTopSuccess: '窗口置顶状态已更新',
languageChanged: '语言设置已更新',
languageChangeFailed: '语言设置更新失败',
themeChanged: '主题设置已更新',
themeChangeFailed: '主题设置更新失败',
systemThemeChanged: '系统主题设置已更新',
systemThemeChangeFailed: '系统主题设置更新失败',
startupSuccess: '开机启动设置已更新',
startupFailed: '开机启动设置失败'
},
languages: {
'zh-CN': '简体中文',
'en-US': 'English'
},
systemTheme: {
dark: '深色',
light: '浅色',
auto: '跟随系统'
},
document: {
loadSuccess: '文档加载成功',
loadFailed: '文档加载失败',
saveSuccess: '文档保存成功',
saveFailed: '文档保存失败',
manualSaveSuccess: '手动保存成功',
settings: {
loadFailed: '加载保存设置失败',
saveSuccess: '保存设置已更新',
saveFailed: '保存设置更新失败'
},
},
migration: {
started: '开始迁移数据',
migrating: '迁移中',
completed: '迁移已完成',
failed: '迁移失败'
},
keybindings: {
headers: {
shortcut: '快捷键',
@@ -88,10 +37,7 @@ export default {
searchToggleWord: '切换整词匹配',
searchToggleRegex: '切换正则表达式匹配',
searchShowReplace: '显示替换功能',
searchFindNext: '查找下一个匹配项',
searchFindPrev: '查找上一个匹配项',
searchReplaceAll: '替换全部匹配项',
searchSelectAll: '选择全部内容',
blockSelectAll: '块内选择全部',
blockAddAfterCurrent: '在当前块后添加新块',
blockAddAfterLast: '在最后添加新块',
@@ -125,7 +71,6 @@ export default {
selectSyntaxRight: '按语法选择右侧',
copyLineUp: '向上复制行',
copyLineDown: '向下复制行',
simplifySelection: '简化选择',
insertBlankLine: '插入空行',
selectLine: '选择行',
selectParentSyntax: '选择父级语法',
@@ -151,10 +96,7 @@ export default {
appearance: '外观',
keyBindings: '快捷键',
updates: '更新',
comingSoon: '即将推出...',
save: '保存',
reset: '重置',
cancel: '取消',
dangerZone: '危险操作',
resetAllSettings: '重置所有设置',
confirmReset: '再次点击确认重置',
@@ -171,7 +113,6 @@ export default {
clickToSelectPath: '点击选择路径',
resetDefault: '恢复默认',
resetToDefaultPath: '恢复为默认路径',
restartRequiredForDataPath: '需要重启应用程序',
fontSize: '字体大小',
fontSizeDescription: '编辑器字体大小',
fontSettings: '字体设置',
@@ -189,15 +130,7 @@ export default {
enableTabIndent: '启用 Tab 缩进',
language: '界面语言',
systemTheme: '系统主题',
theme: '编辑器主题',
themeDescription: '选择编辑器主题',
restartRequired: '(需要重启)',
saveOptions: '保存选项',
autoSaveDelay: '自动保存延迟(毫秒)',
selectDirectoryFailed: '选择目录失败',
validation: {
customPathRequired: '启用自定义路径时必须选择一个有效的目录',
customPathAutoDisabled: '由于未选择有效目录,自定义数据路径已自动关闭'
}
autoSaveDelay: '自动保存延迟(毫秒)'
}
};