chore: simplify translation collection

Use same global variable <COLLECT_TRANSLATIONS> in node and
within the specs.
This commit is contained in:
Nico Rehwaldt 2020-12-21 09:50:14 +01:00 committed by Nico Rehwaldt
parent a276b8f9ad
commit fa0d4957f3
3 changed files with 2 additions and 7 deletions

View File

@ -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);

View File

@ -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 = [];

View File

@ -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) {