35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.I18nChecker = void 0;
|
|
class I18nChecker {
|
|
constructor(pwd, config, program, typeChecker, tsLib) {
|
|
this.pwd = pwd;
|
|
this.config = config;
|
|
this.program = program;
|
|
this.typeChecker = typeChecker;
|
|
this.tsLib = tsLib;
|
|
// i18n 数据缓存
|
|
this.localeDataCache = new Map();
|
|
this.tFunctionCalls = new Map();
|
|
}
|
|
checkFile(sourceFile) {
|
|
// 收集 t() 函数调用
|
|
const tCalls = this.collectTFunctionCalls(sourceFile);
|
|
// 检查 i18n keys
|
|
return this.checkI18nKeys(sourceFile, tCalls);
|
|
}
|
|
collectTFunctionCalls(sourceFile) {
|
|
// 复用原有的 isTCall 逻辑
|
|
const calls = [];
|
|
// ...
|
|
return calls;
|
|
}
|
|
checkI18nKeys(sourceFile, calls) {
|
|
// 复用原有的 checkI18nKeys 逻辑
|
|
const diagnostics = [];
|
|
// ...
|
|
return diagnostics;
|
|
}
|
|
}
|
|
exports.I18nChecker = I18nChecker;
|
|
//# sourceMappingURL=i18nChecker.js.map
|