feat: allow building custom languages during dev

v1.18.x
Barış Soner Uşaklı 5 years ago
parent a33a8a5a27
commit 0a9ea91fea

@ -1,5 +1,6 @@
'use strict';
const nconf = require('nconf');
const path = require('path');
const fs = require('fs');
const util = require('util');
@ -43,7 +44,10 @@ async function getTranslationMetadata() {
languages = _.union(languages, Plugins.languageData.languages).sort().filter(Boolean);
namespaces = _.union(namespaces, Plugins.languageData.namespaces).sort().filter(Boolean);
const configLangs = nconf.get('languages');
if (process.env.NODE_ENV === 'development' && Array.isArray(configLangs) && configLangs.length) {
languages = configLangs;
}
// save a list of languages to `${buildLanguagesPath}/metadata.json`
// avoids readdirs later on
await mkdirp(buildLanguagesPath);

Loading…
Cancel
Save