Carlos Galan Cladera 86025369ad feature(i18n): implement xi18n command (#3340)
Implement i18n messages extractor. Contrary to @angular/complier-cli's command it will not throw an error if a resource is not found.
2017-02-07 19:19:04 -08:00

41 lines
963 B
TypeScript

const Command = require('../ember-cli/lib/models/command');
import {Extracti18nTask} from '../tasks/extract-i18n';
export interface Xi18nOptions {
outputPath?: string;
verbose?: boolean;
i18nFormat?: string;
}
const Xi18nCommand = Command.extend({
name: 'xi18n',
description: 'Extracts i18n messages from source code.',
works: 'insideProject',
availableOptions: [
{
name: 'i18n-format',
type: String,
default: 'xlf',
aliases: ['f', {'xmb': 'xmb'}, {'xlf': 'xlf'}, {'xliff': 'xlf'}]
},
{ name: 'output-path', type: 'Path', default: null, aliases: ['op']},
{ name: 'verbose', type: Boolean, default: false},
{ name: 'progress', type: Boolean, default: true }
],
run: function (commandOptions: any) {
const xi18nTask = new Extracti18nTask({
ui: this.ui,
project: this.project
});
return xi18nTask.run(commandOptions);
}
});
export default Xi18nCommand;