- Go 后端 handler 错误消息统一中文化(middleware/repos/generate/review/settings) - 前端 JS 加载和错误消息中文化(diff-viewer.js, graph.js) - 模板页面错误 fallback 和静态文本中文化(index/generate/review/base) - 消除中英文混杂,提升中文用户体验
This commit is contained in:
+3
-3
@@ -38,7 +38,7 @@ const GitGraph = {
|
||||
async load() {
|
||||
try {
|
||||
const resp = await fetch(`/api/repos/${this.repoId}/graph`, { credentials: 'same-origin' });
|
||||
if (!resp.ok) throw new Error('Failed to load graph');
|
||||
if (!resp.ok) throw new Error('加载提交图失败');
|
||||
const data = await resp.json();
|
||||
|
||||
this.commits = data.commits || [];
|
||||
@@ -47,7 +47,7 @@ const GitGraph = {
|
||||
|
||||
this.render();
|
||||
} catch (err) {
|
||||
this.container.innerHTML = `<div class="text-red-500 p-4">Error loading graph: ${err.message}</div>`;
|
||||
this.container.innerHTML = `<div class="text-red-500 p-4">加载提交图失败: ${err.message}</div>`;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -59,7 +59,7 @@ const GitGraph = {
|
||||
|
||||
render() {
|
||||
if (this.commits.length === 0) {
|
||||
this.container.innerHTML = '<div class="text-gray-500 p-4">No commits found</div>';
|
||||
this.container.innerHTML = '<div class="text-gray-500 p-4">暂无提交记录</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user