UNPKG

@c-sheep/i18n-extract-cli

Version:

这是一款能够自动将代码里的中文转成i18n国际化标记的命令行工具。当然,你也可以用它实现将中文语言包自动翻译成其他语言。适用于vue2、vue3和react

18 lines (17 loc) 860 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.execInit = void 0; const fs_extra_1 = __importDefault(require("fs-extra")); const getAbsolutePath_1 = require("../shared/getAbsolutePath"); const default_config_1 = __importDefault(require("../configs/default.config")); const constants_1 = require("../shared/constants"); const serializeCode_1 = require("../shared/serializeCode"); function execInit() { const configPath = (0, getAbsolutePath_1.getAbsolutePath)(process.cwd(), constants_1.CONFIG_FILE_NAME); const code = (0, serializeCode_1.serializeCode)(default_config_1.default, false); fs_extra_1.default.outputFileSync(configPath, code); } exports.execInit = execInit;