UNPKG

bmc-i18n-extract-cli

Version:

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

47 lines 1.41 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const default_config_1 = __importDefault(require("../default.config")); class StateManager { // eslint-disable-next-line @typescript-eslint/no-empty-function constructor() { this.toolConfig = default_config_1.default; this.currentSourcePath = ''; this.vueScriptLang = 'js'; this.openAIKeyMap = {}; } static getInstance() { if (!this._instance) { this._instance = new StateManager(); } return this._instance; } setToolConfig(config) { this.toolConfig = config; } getToolConfig() { return this.toolConfig; } setCurrentSourcePath(path) { this.currentSourcePath = path; } getCurrentSourcePath() { return this.currentSourcePath; } setVueScriptLang(lang) { this.vueScriptLang = lang || 'js'; } getVueScriptLang() { return this.vueScriptLang; } setOpenAIKeyMap(map) { this.openAIKeyMap = map || {}; } getOpenAIKeyMap() { return this.openAIKeyMap; } } exports.default = StateManager.getInstance(); //# sourceMappingURL=stateManager.js.map