diff --git a/packages/strapi/lib/configuration/hooks/dictionary/_api/index.js b/packages/strapi/lib/configuration/hooks/dictionary/_api/index.js index 89c79c4490..da341efcc1 100644 --- a/packages/strapi/lib/configuration/hooks/dictionary/_api/index.js +++ b/packages/strapi/lib/configuration/hooks/dictionary/_api/index.js @@ -103,16 +103,16 @@ module.exports = strapi => { common: cb => { dictionary.aggregate({ dirname: path.resolve(strapi.config.appPath, strapi.config.paths.api, api, strapi.config.paths.config), + excludeDirs: /(locales|environments)$/, filter: /(.+)\.(js|json)$/, - excludeDirs: /(validators)$/, depth: 2 }, cb); }, specific: cb => { - dictionary.aggregate({ + dictionary.optional({ dirname: path.resolve(strapi.config.appPath, strapi.config.paths.api, api, strapi.config.paths.config, 'environments', strapi.config.environment), filter: /(.+)\.(js|json)$/, - depth: 2 + depth: 1 }, cb); } }, (err, config) => { diff --git a/packages/strapi/lib/configuration/hooks/dictionary/_plugins/index.js b/packages/strapi/lib/configuration/hooks/dictionary/_plugins/index.js index d6a2c74299..af405e0cc3 100644 --- a/packages/strapi/lib/configuration/hooks/dictionary/_plugins/index.js +++ b/packages/strapi/lib/configuration/hooks/dictionary/_plugins/index.js @@ -94,15 +94,16 @@ module.exports = strapi => { common: cb => { dictionary.aggregate({ dirname: path.resolve(strapi.config.appPath, strapi.config.paths.plugins, plugin, strapi.config.paths.config), + excludeDirs: /(locales|environments)$/, filter: /(.+)\.(js|json)$/, depth: 2 }, cb); }, specific: cb => { - dictionary.aggregate({ + dictionary.optional({ dirname: path.resolve(strapi.config.appPath, strapi.config.paths.plugins, plugin, strapi.config.paths.config, 'environments', strapi.config.environment), filter: /(.+)\.(js|json)$/, - depth: 2 + depth: 1 }, cb); } }, (err, config) => {