rucken
Version:
Console tools and scripts for nx and not only that I (EndyKaufman) use to automate the workflow and speed up the development process
74 lines • 3.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Extracti18nCommands = void 0;
const tslib_1 = require("tslib");
const nestjs_console_1 = require("../../nestjs-console");
const utils_service_1 = require("../utils/utils.service");
const extract_i18n_config_1 = require("./extract-i18n.config");
const extract_i18n_service_1 = require("./extract-i18n.service");
let Extracti18nCommands = class Extracti18nCommands {
extracti18nService;
utilsService;
config = {};
constructor(extracti18nService, utilsService) {
this.extracti18nService = extracti18nService;
this.utilsService = utilsService;
this.config = this.utilsService.getRuckenConfig(extract_i18n_config_1.DEFAULT_EXTRACT_I18N_CONFIG)
.extracti18n;
}
async extracti18n({ locales, resetUnusedTranslates, clientProjectNameParts, e2eProjectNameParts, serverProjectNameParts, }) {
this.extracti18nService.setLogger(extract_i18n_service_1.Extracti18nService.title);
this.extracti18nService.extract({
locales: locales ? locales.split(',') : this.config.locales,
markers: this.config.markers,
resetUnusedTranslates: (resetUnusedTranslates ||
this.config.resetUnusedTranslates ||
'false').toLowerCase() === 'true',
clientProjectNameParts: clientProjectNameParts?.split(',') ||
this.config.clientProjectNameParts,
e2eProjectNameParts: e2eProjectNameParts?.split(',') ||
this.config.e2eProjectNameParts,
serverProjectNameParts: serverProjectNameParts?.split(',') ||
this.config.serverProjectNameParts,
});
}
};
exports.Extracti18nCommands = Extracti18nCommands;
tslib_1.__decorate([
(0, nestjs_console_1.Command)({
command: 'extract-i18n',
description: 'translate marker extractor (use: transloco-keys-manager + transloco-scoped-libs)',
options: [
{
flags: '-l,--locales [strings]',
description: 'list of available languages (example: ru,en)',
},
{
flags: '--reset-unused-translates [boolean]',
description: 'remove all translates if they not found in source code (default: true)',
defaultValue: 'true',
},
{
flags: '--e2e-project-name-parts [string]',
defaultValue: 'e2e',
},
{
flags: '--client-project-name-parts [string]',
defaultValue: 'client',
},
{
flags: '--server-project-name-parts [string]',
defaultValue: 'server,-ms',
},
],
}),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", [Object]),
tslib_1.__metadata("design:returntype", Promise)
], Extracti18nCommands.prototype, "extracti18n", null);
exports.Extracti18nCommands = Extracti18nCommands = tslib_1.__decorate([
(0, nestjs_console_1.Console)(),
tslib_1.__metadata("design:paramtypes", [extract_i18n_service_1.Extracti18nService,
utils_service_1.UtilsService])
], Extracti18nCommands);
//# sourceMappingURL=extract-i18n.commands.js.map