|
|
@@ -1,6 +1,6 @@
|
|
|
import mongoose from 'mongoose';
|
|
|
|
|
|
-import { allLocales, localePath } from '~/next-i18next.config';
|
|
|
+import { i18n, localePath } from '~/next-i18next.config';
|
|
|
|
|
|
module.exports = function(crowi, app) {
|
|
|
const debug = require('debug')('growi:crowi:express-init');
|
|
|
@@ -42,7 +42,7 @@ module.exports = function(crowi, app) {
|
|
|
.init({
|
|
|
// debug: true,
|
|
|
fallbackLng: ['en_US'],
|
|
|
- whitelist: allLocales,
|
|
|
+ whitelist: i18n.locales,
|
|
|
backend: {
|
|
|
loadPath: `${localePath}/{{lng}}/translation.json`,
|
|
|
},
|
|
|
@@ -79,13 +79,6 @@ module.exports = function(crowi, app) {
|
|
|
res.locals.baseUrl = crowi.appService.getSiteUrl();
|
|
|
res.locals.env = env;
|
|
|
res.locals.now = now;
|
|
|
- res.locals.consts = {
|
|
|
- pageGrants: Page.getGrantLabels(),
|
|
|
- userStatus: User.getUserStatusLabels(),
|
|
|
- language: allLocales,
|
|
|
- restrictGuestMode: crowi.aclService.getRestrictGuestModeLabels(),
|
|
|
- registrationMode: crowi.aclService.getRegistrationModeLabels(),
|
|
|
- };
|
|
|
res.locals.local_config = Config.getLocalconfig(crowi); // config for browser context
|
|
|
|
|
|
next();
|