Merge pull request #836 from SISheogorath/fix/i18n-files
Fix i18n writing locale files in production
This commit is contained in:
commit
6f76e9940f
2 changed files with 5 additions and 1 deletions
3
app.js
3
app.js
|
@ -131,7 +131,8 @@ if (config.csp.enable) {
|
||||||
i18n.configure({
|
i18n.configure({
|
||||||
locales: ['en', 'zh', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da'],
|
locales: ['en', 'zh', 'zh-CN', 'zh-TW', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da'],
|
||||||
cookie: 'locale',
|
cookie: 'locale',
|
||||||
directory: path.join(__dirname, '/locales')
|
directory: path.join(__dirname, '/locales'),
|
||||||
|
updateFiles: config.updateI18nFiles
|
||||||
})
|
})
|
||||||
|
|
||||||
app.use(cookieParser())
|
app.use(cookieParser())
|
||||||
|
|
|
@ -102,6 +102,9 @@ config.isSAMLEnable = config.saml.idpSsoUrl
|
||||||
config.isOAuth2Enable = config.oauth2.clientID && config.oauth2.clientSecret
|
config.isOAuth2Enable = config.oauth2.clientID && config.oauth2.clientSecret
|
||||||
config.isPDFExportEnable = config.allowPDFExport
|
config.isPDFExportEnable = config.allowPDFExport
|
||||||
|
|
||||||
|
// Only update i18n files in development setups
|
||||||
|
config.updateI18nFiles = (env === Environment.development)
|
||||||
|
|
||||||
// merge legacy values
|
// merge legacy values
|
||||||
let keys = Object.keys(config)
|
let keys = Object.keys(config)
|
||||||
const uppercase = /[A-Z]/
|
const uppercase = /[A-Z]/
|
||||||
|
|
Loading…
Reference in a new issue