1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-11-11 05:32:40 +01:00
send/server/languages.js

19 lines
469 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-08-25 20:43:59 +02:00
const langs = fs.readdirSync(
path.join(__dirname, '..', 'dist', 'public', 'locales')
);
langs.unshift('en-US'); // default first, TODO change for fluent-langneg
return langs;
}
if (config.l10n_dev) {
module.exports = allLangs();
} else {
module.exports = availableLanguages;
}