Skip to content

Commit

Permalink
feat: allow building custom languages during dev
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Jul 24, 2020
1 parent a33a8a5 commit 0a9ea91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/meta/languages.js
@@ -1,5 +1,6 @@
'use strict';

const nconf = require('nconf');
const path = require('path');
const fs = require('fs');
const util = require('util');
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0a9ea91

Please sign in to comment.