mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-29 01:39:48 +08:00
✨ feat(i18n): 完善多模块多语言适配与发版验证
扩展前后端多语言文案与共享词典。增加多模块 i18n 回归测试与 guard。收口外部 SQL 菜单和弹窗多语言文案。
This commit is contained in:
@@ -14,48 +14,55 @@ export type DataSyncEntryModePresentation = {
|
||||
readOnly: boolean;
|
||||
};
|
||||
|
||||
export const resolveDataSyncEntryModePresentation = (entryMode: DataSyncEntryMode): DataSyncEntryModePresentation => {
|
||||
type DataSyncEntryModeTranslator = (key: string) => string;
|
||||
|
||||
const text = (key: string, t?: DataSyncEntryModeTranslator) => (t ? t(key) : key);
|
||||
|
||||
export const resolveDataSyncEntryModePresentation = (
|
||||
entryMode: DataSyncEntryMode,
|
||||
t?: DataSyncEntryModeTranslator,
|
||||
): DataSyncEntryModePresentation => {
|
||||
switch (entryMode) {
|
||||
case 'schemaCompare':
|
||||
return {
|
||||
title: '表结构比对',
|
||||
description: '按源表与目标表生成结构差异、兼容风险和可审阅 SQL。',
|
||||
heroTitle: '表结构比对',
|
||||
heroDescription: '适合发布前核对两端表结构差异,只做分析与预览,不执行结构变更。',
|
||||
optionTitle: '比对选项',
|
||||
tableSelectLabel: '请选择需要比对结构的表:',
|
||||
analyzeButtonText: '开始比对',
|
||||
closeButtonText: '关闭',
|
||||
badgeText: '结构比对',
|
||||
resultTitle: '比对结果',
|
||||
title: text('data_sync.entry_mode.schema_compare.title', t),
|
||||
description: text('data_sync.entry_mode.schema_compare.description', t),
|
||||
heroTitle: text('data_sync.entry_mode.schema_compare.title', t),
|
||||
heroDescription: text('data_sync.entry_mode.schema_compare.hero_description', t),
|
||||
optionTitle: text('data_sync.entry_mode.compare.option_title', t),
|
||||
tableSelectLabel: text('data_sync.entry_mode.schema_compare.table_select_label', t),
|
||||
analyzeButtonText: text('data_sync.entry_mode.compare.action.start', t),
|
||||
closeButtonText: text('data_sync.action.close', t),
|
||||
badgeText: text('data_sync.entry_mode.schema_compare.badge', t),
|
||||
resultTitle: text('data_sync.entry_mode.compare.result_title', t),
|
||||
readOnly: true,
|
||||
};
|
||||
case 'dataCompare':
|
||||
return {
|
||||
title: '数据比对',
|
||||
description: '按主键对比源表与目标表的数据差异,查看新增、更新和删除明细。',
|
||||
heroTitle: '数据比对',
|
||||
heroDescription: '适合核对两端数据一致性,只做差异分析与行级预览,不执行写入。',
|
||||
optionTitle: '比对选项',
|
||||
tableSelectLabel: '请选择需要比对数据的表:',
|
||||
analyzeButtonText: '开始比对',
|
||||
closeButtonText: '关闭',
|
||||
badgeText: '数据比对',
|
||||
resultTitle: '比对结果',
|
||||
title: text('data_sync.entry_mode.data_compare.title', t),
|
||||
description: text('data_sync.entry_mode.data_compare.description', t),
|
||||
heroTitle: text('data_sync.entry_mode.data_compare.title', t),
|
||||
heroDescription: text('data_sync.entry_mode.data_compare.hero_description', t),
|
||||
optionTitle: text('data_sync.entry_mode.compare.option_title', t),
|
||||
tableSelectLabel: text('data_sync.entry_mode.data_compare.table_select_label', t),
|
||||
analyzeButtonText: text('data_sync.entry_mode.compare.action.start', t),
|
||||
closeButtonText: text('data_sync.action.close', t),
|
||||
badgeText: text('data_sync.entry_mode.data_compare.badge', t),
|
||||
resultTitle: text('data_sync.entry_mode.compare.result_title', t),
|
||||
readOnly: true,
|
||||
};
|
||||
default:
|
||||
return {
|
||||
title: '数据同步工作台',
|
||||
description: '按已有目标表完成差异对比、同步执行与结果确认。',
|
||||
heroTitle: '数据同步',
|
||||
heroDescription: '适合目标表已存在的场景,先做差异分析,再按勾选执行插入、更新或删除。',
|
||||
optionTitle: '同步选项',
|
||||
tableSelectLabel: '请选择需要同步的表:',
|
||||
analyzeButtonText: '对比差异',
|
||||
closeButtonText: '关闭',
|
||||
badgeText: '同步模式',
|
||||
resultTitle: '执行结果',
|
||||
title: text('data_sync.title.sync_workbench', t),
|
||||
description: text('data_sync.title.sync_description', t),
|
||||
heroTitle: text('data_sync.title.sync', t),
|
||||
heroDescription: text('data_sync.entry_mode.sync.hero_description', t),
|
||||
optionTitle: text('data_sync.title.sync_options', t),
|
||||
tableSelectLabel: text('data_sync.help.select_tables', t),
|
||||
analyzeButtonText: text('data_sync.action.analyze_diff', t),
|
||||
closeButtonText: text('data_sync.action.close', t),
|
||||
badgeText: text('data_sync.badge.sync_mode', t),
|
||||
resultTitle: text('data_sync.step.result', t),
|
||||
readOnly: false,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user