Extract list of supported languages in separate file

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2021-04-26 00:18:08 +02:00 committed by David Mehren
parent cf87499e38
commit 0d943d1284
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 49 additions and 45 deletions

5
app.js
View file

@ -28,6 +28,8 @@ const models = require('./lib/models')
const csp = require('./lib/csp')
const metrics = require('./lib/prometheus')
const supportedLocalesList = Object.keys(require('./locales/_supported.json'))
// server setup
const app = express()
let server = null
@ -126,8 +128,7 @@ if (config.csp.enable) {
}
i18n.configure({
locales: ['en', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl',
'uk', 'hi', 'sv', 'eo', 'da', 'ko', 'id', 'sr', 'vi', 'ar', 'cs', 'sk', 'ml', 'bg', 'fa', 'gl', 'he', 'hu', 'oc', 'pt-br'],
locales: supportedLocalesList,
cookie: 'locale',
indent: ' ', // this is the style poeditor.com exports it, this creates less churn
directory: path.join(__dirname, '/locales'),