feat: locales remote fetch+ deps update + fixes

This commit is contained in:
NGPixel
2018-04-29 17:55:36 -04:00
parent 3752cf7415
commit 7786f9042f
30 changed files with 1374 additions and 1106 deletions

View File

@@ -283,7 +283,7 @@ module.exports = () => {
// Site namespace
_.set(WIKI.config.site, 'title', req.body.title)
_.set(WIKI.config.site, 'lang', req.body.lang)
_.set(WIKI.config.site, 'lang', 'en')
_.set(WIKI.config.site, 'rtl', _.includes(WIKI.data.rtlLangs, req.body.lang))
_.set(WIKI.config.site, 'sessionSecret', (await crypto.randomBytesAsync(32)).toString('hex'))
@@ -310,6 +310,16 @@ module.exports = () => {
tfaIsActive: false
})
// Create default locale
WIKI.logger.info('Installing default locale...')
await WIKI.db.Locale.upsert({
code: 'en',
strings: require('./locales/default.json'),
isRTL: false,
name: 'English',
nativeName: 'English'
})
WIKI.logger.info('Setup is complete!')
res.json({
ok: true,