chore: simplify translation collection
Use same global variable <COLLECT_TRANSLATIONS> in node and within the specs.
This commit is contained in:
parent
a276b8f9ad
commit
fa0d4957f3
|
@ -92,10 +92,7 @@ module.exports = function(karma) {
|
||||||
if (collectTranslations) {
|
if (collectTranslations) {
|
||||||
config.plugins = [].concat(config.plugins || [], 'karma-*', require('./translation-reporter'));
|
config.plugins = [].concat(config.plugins || [], 'karma-*', require('./translation-reporter'));
|
||||||
config.reporters = [].concat(config.reporters || [], 'translation-reporter');
|
config.reporters = [].concat(config.reporters || [], 'translation-reporter');
|
||||||
|
config.envPreprocessor = [].concat(config.envPreprocessor || [], 'COLLECT_TRANSLATIONS');
|
||||||
config.envPreprocessor = [
|
|
||||||
'TRANSLATIONS'
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
karma.set(config);
|
karma.set(config);
|
||||||
|
|
|
@ -8,8 +8,6 @@ var {
|
||||||
|
|
||||||
|
|
||||||
function TranslationReporter() {
|
function TranslationReporter() {
|
||||||
process.env.TRANSLATIONS = 'enabled';
|
|
||||||
|
|
||||||
var translationsFile = path.join(__dirname, '../../docs/translations.json');
|
var translationsFile = path.join(__dirname, '../../docs/translations.json');
|
||||||
|
|
||||||
var translations = [];
|
var translations = [];
|
||||||
|
|
|
@ -46,7 +46,7 @@ var OPTIONS, BPMN_JS;
|
||||||
|
|
||||||
import translationModule from './TranslationCollector';
|
import translationModule from './TranslationCollector';
|
||||||
|
|
||||||
export var collectTranslations = window.__env__ && window.__env__.TRANSLATIONS === 'enabled';
|
export var collectTranslations = window.__env__ && window.__env__.COLLECT_TRANSLATIONS;
|
||||||
|
|
||||||
// inject logging translation module into default modules
|
// inject logging translation module into default modules
|
||||||
if (collectTranslations) {
|
if (collectTranslations) {
|
||||||
|
|
Loading…
Reference in New Issue