mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-22 00:42:47 +08:00
✨ feat(i18n): 推进多语言剩余切片闭环
- 补齐 DataGrid、DataViewer、DefinitionViewer、JVM 等模块多语言文案与回归测试 - 收口 JVM 前后端展示、诊断、监控和资源呈现相关多语言路径 - 更新六语言共享词典并保留 raw 边界
This commit is contained in:
@@ -28,6 +28,11 @@ export type ResolveRowLocatorValuesResult =
|
||||
| { ok: true; values: Record<string, any> }
|
||||
| { ok: false; error: string };
|
||||
|
||||
export type RowLocatorMessages = {
|
||||
noSafeLocator?: () => string;
|
||||
emptyLocatorValue?: (column: string) => string;
|
||||
};
|
||||
|
||||
const normalizeColumnName = (value: string): string => String(value || '').trim();
|
||||
|
||||
const hasColumn = (columns: string[], target: string): boolean => {
|
||||
@@ -103,9 +108,10 @@ export const resolveEditRowLocator = ({
|
||||
export const resolveRowLocatorValues = (
|
||||
locator: EditRowLocator | undefined,
|
||||
row: Record<string, any>,
|
||||
messages?: RowLocatorMessages,
|
||||
): ResolveRowLocatorValuesResult => {
|
||||
if (!locator || locator.readOnly || locator.strategy === 'none') {
|
||||
return { ok: false, error: '当前结果没有可用的安全行定位方式,无法提交修改。' };
|
||||
return { ok: false, error: messages?.noSafeLocator?.() || 'No safe row locator is available for this result set.' };
|
||||
}
|
||||
|
||||
const values: Record<string, any> = {};
|
||||
@@ -114,7 +120,7 @@ export const resolveRowLocatorValues = (
|
||||
const valueColumn = locator.valueColumns[index] || column;
|
||||
const value = row?.[valueColumn];
|
||||
if (value === null || value === undefined || value === '') {
|
||||
return { ok: false, error: `定位列 ${column} 的值为空,无法安全提交修改。` };
|
||||
return { ok: false, error: messages?.emptyLocatorValue?.(column) || `Locator column ${column} is empty, so changes cannot be submitted safely.` };
|
||||
}
|
||||
values[column] = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user