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
53 lines (52 loc) • 2.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GettextCommands = void 0;
const tslib_1 = require("tslib");
const nestjs_console_1 = require("../../nestjs-console");
const utils_service_1 = require("../utils/utils.service");
const gettext_config_1 = require("./gettext.config");
const gettext_service_1 = require("./gettext.service");
let GettextCommands = class GettextCommands {
constructor(gettextService, utilsService) {
this.gettextService = gettextService;
this.utilsService = utilsService;
this.config = this.utilsService.getRuckenConfig(gettext_config_1.DEFAULT_GETTEXT_CONFIG).gettext;
}
gettext({ defaultLocale, locales, }) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
this.gettextService.setLogger(gettext_service_1.GettextService.title);
yield this.gettextService.extractTranslatesFromSourcesForLibraries({
po2jsonOptions: this.config.po2jsonOptions,
pattern: this.config.gettextExtractorOptions.pattern,
locales: locales ? locales.split(',') : this.config.locales,
defaultLocale: defaultLocale || this.config.defaultLocale,
markers: this.config.markers,
});
});
}
};
tslib_1.__decorate([
(0, nestjs_console_1.Command)({
command: 'gettext',
description: 'translate marker extractor',
options: [
{
flags: '-l,--locales [strings]',
description: 'list of available languages (example: ru,en)',
},
{
flags: '-dl,--default-locale [string]',
description: 'default locale (default: en)',
},
],
}),
tslib_1.__metadata("design:type", Function),
tslib_1.__metadata("design:paramtypes", [Object]),
tslib_1.__metadata("design:returntype", Promise)
], GettextCommands.prototype, "gettext", null);
GettextCommands = tslib_1.__decorate([
(0, nestjs_console_1.Console)(),
tslib_1.__metadata("design:paramtypes", [gettext_service_1.GettextService,
utils_service_1.UtilsService])
], GettextCommands);
exports.GettextCommands = GettextCommands;