i18n 国际化全量接入 + 修复与 UI 增强
- 引入 i18n 系统,所有用户可见字符串替换为 t() 调用,支持中/EN/日三语 - 插件激活时读取 ai.outputLanguage 配置初始化语言,onDidChangeConfiguration 监听变更自动切换 - ReviewPanel 与 SetupViewProvider 注册 onLanguageChange 回调,语言切换时全量重渲染 - package.json description:"AI 输出语言" -> "插件语言" - 修复 repairJsonEscapes 无差别解引号导致 JSON 解析失败 - 设置页规则名称空值时输入框红框 + 错误提示 - 规则导入流程添加 withProgress 加载提示
This commit is contained in:
+2
-1
@@ -4,6 +4,7 @@ import { existsSync } from 'fs';
|
||||
import { execSync, spawn } from 'child_process';
|
||||
import type { LinterAdapter, LinterDiagnostic, AdapterResult } from '../types';
|
||||
import { getPMDRulesetPath } from '../config';
|
||||
import { t } from '../i18n/messages';
|
||||
|
||||
export class PmdAdapter implements LinterAdapter {
|
||||
id = 'pmd';
|
||||
@@ -57,7 +58,7 @@ export class PmdAdapter implements LinterAdapter {
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
if (message.includes('ENOENT') || message.includes('java not found') || message.includes('Cannot find')) {
|
||||
return { diagnostics: [], status: 'tool-unavailable', errorMessage: 'Java 11+ 未安装或不在 PATH 中' };
|
||||
return { diagnostics: [], status: 'tool-unavailable', errorMessage: t('adapter.javaNotInstalled') };
|
||||
}
|
||||
return { diagnostics: [], status: 'execution-failed', errorMessage: message };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user