send/server/languages.js

17 lines
371 B
JavaScript
Raw Normal View History

const { availableLanguages } = require('../package.json');
const config = require('./config');
const fs = require('fs');
const path = require('path');
function allLangs() {
2017-11-10 20:40:18 +00:00
return fs.readdirSync(
2017-08-25 18:43:59 +00:00
path.join(__dirname, '..', 'dist', 'public', 'locales')
);
}
if (config.l10n_dev) {
module.exports = allLangs();
} else {
module.exports = availableLanguages;
}