161 lines
6.6 KiB
TypeScript
161 lines
6.6 KiB
TypeScript
// 中文界面文案表:全站 UI 文本的唯一来源。
|
|||
|
|
|
||
|
|
export const zhCN = {
|
||
|
|
appName: 'ChuSQL 数据库终端',
|
||
|
|
signingIn: '正在检查登录状态…',
|
||
|
|
signInTitle: '登录 ChuSQL',
|
||
|
|
userName: '用户名',
|
||
|
|
password: '密码',
|
||
|
|
signIn: '登录',
|
||
|
|
signInFailed: '登录失败,请检查用户名和密码',
|
||
|
|
connection: '本地连接',
|
||
|
|
database: 'chusql',
|
||
|
|
explorer: '资源管理器',
|
||
|
|
databaseSection: '数据库',
|
||
|
|
activityBar: '活动栏',
|
||
|
|
selectionColumn: '选择',
|
||
|
|
changesSection: '变更集',
|
||
|
|
historySection: '历史',
|
||
|
|
sqlConsole: 'SQL 控制台',
|
||
|
|
newQuery: '新建查询',
|
||
|
|
runNext: '单步执行',
|
||
|
|
runAll: '全部执行',
|
||
|
|
runSelection: '执行选中',
|
||
|
|
stop: '停止',
|
||
|
|
statementPending: '待执行',
|
||
|
|
statementRunning: '执行中',
|
||
|
|
statementSuccess: '成功',
|
||
|
|
statementFailed: '失败',
|
||
|
|
executionStopped: '已停止;已发出的语句可能仍在服务端运行',
|
||
|
|
executionSuccess: (rows: number, duration: number) => `执行成功,返回 ${rows} 行 (${duration.toFixed(1)} ms)`,
|
||
|
|
executionAffected: (rows: number, duration: number) => `执行成功,影响 ${rows} 行 (${duration.toFixed(1)} ms)`,
|
||
|
|
resultLabel: (index: number, rows: number, duration: number) => `结果 ${index} (${rows} 行, ${duration.toFixed(1)} ms)`,
|
||
|
|
noStatement: '没有可执行的 SQL 语句',
|
||
|
|
queryHistory: '查询历史',
|
||
|
|
settings: '设置',
|
||
|
|
settingsAppearance: '外观与字体',
|
||
|
|
settingsBehavior: '数据与编辑器',
|
||
|
|
interfaceFont: '界面字体',
|
||
|
|
gridFont: '表格字体',
|
||
|
|
sqlFont: 'SQL 编辑器字体',
|
||
|
|
fontName: '字体名称',
|
||
|
|
addFallback: '添加备用字体',
|
||
|
|
removeFont: (font: string) => `删除字体 ${font}`,
|
||
|
|
moveFont: '拖动调整字体顺序',
|
||
|
|
fontSize: '字号',
|
||
|
|
rowHeight: '行高',
|
||
|
|
tabSize: 'Tab 宽度',
|
||
|
|
showLineNumbers: '显示行号',
|
||
|
|
pageSize: '分页大小',
|
||
|
|
nullDisplay: 'NULL 显示文本',
|
||
|
|
autocomplete: '自动补全',
|
||
|
|
minimap: 'Minimap',
|
||
|
|
restoreDefaults: '恢复默认',
|
||
|
|
preview: '实时预览',
|
||
|
|
previewText: 'ChuSQL 数据库终端 SELECT * FROM users;',
|
||
|
|
commit: (count: number) => `提交 (${count})`,
|
||
|
|
rollback: '回滚',
|
||
|
|
undo: '撤销',
|
||
|
|
redo: '重做',
|
||
|
|
insertRow: '插入行',
|
||
|
|
deleteRows: '删除选中行',
|
||
|
|
batchReplace: '批量替换',
|
||
|
|
findText: '查找内容',
|
||
|
|
replaceText: '替换为',
|
||
|
|
replaceSelected: '替换选中区域',
|
||
|
|
selectedRowsRequired: '请先选择要操作的行',
|
||
|
|
refresh: '刷新',
|
||
|
|
filter: (column: string) => `筛选 ${column}`,
|
||
|
|
openTable: (table: string) => `打开表 ${table}`,
|
||
|
|
closeTab: (table: string) => `关闭 ${table}`,
|
||
|
|
editCell: (column: string) => `编辑 ${column}`,
|
||
|
|
rowSelect: (row: number) => `选择第 ${row} 行`,
|
||
|
|
noRows: '没有符合条件的数据',
|
||
|
|
loading: '正在加载…',
|
||
|
|
loadError: '加载失败',
|
||
|
|
retry: '重试',
|
||
|
|
previousPage: '上一页',
|
||
|
|
nextPage: '下一页',
|
||
|
|
loadMore: '加载更多',
|
||
|
|
pendingChanges: '待提交变更',
|
||
|
|
updateChange: (table: string, column: string) => `修改 ${table}.${column}`,
|
||
|
|
insertChange: (table: string) => `向 ${table} 插入一行`,
|
||
|
|
deleteChange: (table: string) => `从 ${table} 删除一行`,
|
||
|
|
createTableChange: (table: string) => `新建表 ${table}`,
|
||
|
|
dropTableChange: (table: string) => `删除表 ${table}`,
|
||
|
|
createIndexChange: (table: string, column: string) => `为 ${table}.${column} 建索引`,
|
||
|
|
dropIndexChange: (table: string, column: string) => `删除 ${table}.${column} 的索引`,
|
||
|
|
undoChange: '撤销此变更',
|
||
|
|
noPendingChanges: '没有待提交变更',
|
||
|
|
noResults: '尚无查询结果',
|
||
|
|
results: '结果',
|
||
|
|
messages: '消息',
|
||
|
|
cancel: '取消',
|
||
|
|
committed: (count: number) => `已提交 ${count} 项变更`,
|
||
|
|
commitFailed: '提交失败,变更已保留',
|
||
|
|
rowCount: (count: number) => `${count} 行`,
|
||
|
|
pendingCount: (count: number) => `待提交 ${count} 项`,
|
||
|
|
nullValue: 'NULL',
|
||
|
|
emptyWorkspace: '从左侧资源管理器打开一张表,或打开 SQL 控制台。',
|
||
|
|
queryTab: (index: number) => `查询 ${index}`,
|
||
|
|
resizeSidebar: '拖动调整侧边栏宽度',
|
||
|
|
resizeDock: '拖动调整底部面板高度',
|
||
|
|
close: '关闭',
|
||
|
|
booleanTrue: '是',
|
||
|
|
booleanFalse: '否',
|
||
|
|
done: '完成',
|
||
|
|
clear: '清空',
|
||
|
|
remove: '移除',
|
||
|
|
newTable: '新建表',
|
||
|
|
expandColumns: (table: string) => `展开 ${table} 的列`,
|
||
|
|
manageIndexes: (table: string) => `管理 ${table} 的索引`,
|
||
|
|
dropTableAction: (table: string) => `删除表 ${table}`,
|
||
|
|
columnPrimaryKey: '主键列',
|
||
|
|
columnIndexed: '索引列',
|
||
|
|
columnOrdinary: '普通列',
|
||
|
|
newTableTitle: '新建表',
|
||
|
|
dropTableTitle: '删除表',
|
||
|
|
indexManagerTitle: '索引管理',
|
||
|
|
tableName: '表名',
|
||
|
|
columnName: (index: number) => `列名 ${index}`,
|
||
|
|
columnType: (index: number) => `列类型 ${index}`,
|
||
|
|
removeColumn: (index: number) => `移除第 ${index} 列`,
|
||
|
|
addColumn: '添加列',
|
||
|
|
createTable: '建表',
|
||
|
|
dropTablePermanently: '永久删除表',
|
||
|
|
typeInt: '整数',
|
||
|
|
typeStr: '文本',
|
||
|
|
typeBool: '布尔',
|
||
|
|
typeDate: '日期',
|
||
|
|
stagedMessage: (sql: string) => `已暂存:${sql}`,
|
||
|
|
builtinIndex: '内建主键索引',
|
||
|
|
uniqueIndex: '唯一索引',
|
||
|
|
noIndex: '无索引',
|
||
|
|
createIndex: '建索引',
|
||
|
|
deleteIndex: '删索引',
|
||
|
|
createTableHint: '作为待提交变更暂存,提交时建表。整数 id 固定为内建主键;至少填一列,并删掉多余的空列。',
|
||
|
|
dropTableHint: (table: string, rows: number) => `作为待提交变更暂存:提交后会删掉 ${table} 的全部 ${rows} 行、列定义与索引,且不可撤销。`,
|
||
|
|
indexHint: '索引变更先暂存,提交时才下发。目前只支持唯一整数索引,列里有重复值时提交会失败;内建 id 索引不能删除。',
|
||
|
|
invalidIdentifier: '表名与列名必须以字母或下划线开头,且只能包含字母、数字与下划线。',
|
||
|
|
duplicateColumns: '列名重复',
|
||
|
|
insertRowTitle: (table: string) => `插入行 · ${table}`,
|
||
|
|
addToPending: '加入待提交',
|
||
|
|
insertRowHint: '每个字段都要填。加入后仍可修改或撤销,点顶部的「提交」才会写入数据库。',
|
||
|
|
primaryKeyBadge: ' · 主键(必填且唯一)',
|
||
|
|
invalidInteger: (column: string) => `${column}:请输入合法整数`,
|
||
|
|
chooseDate: (column: string) => `${column}:请选择日期`,
|
||
|
|
selectRowsHint: '单击选中一行;Ctrl+单击多选,Shift+单击连选,空格键也可选中',
|
||
|
|
selectedRows: (count: number) => `已选 ${count} 行`,
|
||
|
|
rowStaged: '新行已加入待提交',
|
||
|
|
filterPlaceholder: '筛选表达式',
|
||
|
|
resizeColumn: (column: string) => `调整 ${column} 列宽`,
|
||
|
|
} as const;
|
||
|
|
|
||
|
|
export const columnTypeLabels: Record<string, string> = {
|
||
|
|
int: zhCN.typeInt,
|
||
|
|
str: zhCN.typeStr,
|
||
|
|
bool: zhCN.typeBool,
|
||
|
|
date: zhCN.typeDate,
|
||
|
|
};
|
||
|
|
|
||
|
|
export type Messages = typeof zhCN;
|