fix(i18n): translate backend errors at UI boundaries

This commit is contained in:
Rahul authored and GitHub committed 2026-07-29 02:40:45 +08:00
1 parent 4422ac8e01
commit 2f44d36018
82 files changed
+1862 -335

No files matched your search

+1 -1
View File
@@ -226,7 +226,7 @@ async fn ensure_no_agent_update_blockers(state: &AppState, db_types: &[String])
return Ok(());
}
let labels = blockers.into_iter().map(|blocker| blocker.label).collect::<Vec<_>>().join(", ");
Err(format!("请先关闭以下数据库连接后再更新驱动: {labels}"))
Err(format!("Close these database connections before updating drivers: {labels}"))
}
async fn ensure_no_offline_import_blockers(state: &AppState, plan: &OfflineImportPlan) -> Result<(), String> {
+2 -2
View File
@@ -63,7 +63,7 @@ fn validate_path(raw: &str) -> Result<PathBuf, String> {
return Err(format!("path is not absolute: {expanded}"));
}
if !path.exists() {
return Err(format!("文件不存在: {expanded}"));
return Err(format!("file does not exist: {expanded}"));
}
Ok(path)
}
@@ -151,7 +151,7 @@ mod tests {
"/__dbx_definitely_missing__/foo.sqlite".to_string()
};
let err = validate_path(&probe).unwrap_err();
assert!(err.contains("文件不存在"));
assert!(err.contains("file does not exist"));
}
#[test]