i18-fe-automator
Version:
前端代码提取中文并替换成$t函数
15 lines (14 loc) • 609 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocaleDir = void 0;
const stateManager_1 = __importDefault(require("./stateManager"));
function getLocaleDir() {
const { localeFileType, localePath } = stateManager_1.default.getToolConfig();
const reg = new RegExp(`/[A-Za-z-]+.${localeFileType}`, 'g');
const localeDirPath = localePath.replace(reg, '');
return localeDirPath;
}
exports.getLocaleDir = getLocaleDir;