Comparing version 1.1.0 to 1.1.1
@@ -107,4 +107,5 @@ 'use strict'; | ||
/* istanbul ignore next */ | ||
app.config.i18n.dirs = Array.isArray(app.config.i18n.dirs) ? app.config.i18n.dirs : []; | ||
// 按 egg > 插件 > 框架 > 应用的顺序遍历 config/locales 目录,加载所有配置文件 | ||
app.config.i18n.dirs = app.config.i18n.dirs || []; | ||
for (const unit of app.loader.getLoadUnits()) { | ||
@@ -111,0 +112,0 @@ app.config.i18n.dirs.push(path.join(unit.path, 'config/locales')); |
'use strict'; | ||
const path = require('path'); | ||
module.exports = () => { | ||
module.exports = appInfo => { | ||
const exports = {}; | ||
@@ -13,3 +11,3 @@ | ||
* @property {String} defaultLocale - 默认语言是美式英语,毕竟支持多语言,基本都是以英语为母板 | ||
* @property {String} dir - 多语言资源文件存放路径,不建议修改 | ||
* @property {Array} dirs - 多语言资源文件存放路径,不建议修改 | ||
* @property {String} queryField - 设置当前语言的 query 参数字段名,默认通过 `query.locale` 获取 | ||
@@ -24,3 +22,3 @@ * 如果你想修改为 `query.lang`,那么请通过修改此配置实现 | ||
defaultLocale: 'en_US', | ||
dir: path.join(appInfo.baseDir, 'config/locales'), | ||
dirs: [], | ||
queryField: 'locale', | ||
@@ -27,0 +25,0 @@ cookieField: 'locale', |
1.1.1 / 2017-04-19 | ||
================== | ||
* fix: config.i18n.dir should be config.i18n.dirs (#6) | ||
1.1.0 / 2017-01-13 | ||
@@ -3,0 +8,0 @@ ================== |
{ | ||
"name": "egg-i18n", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"eggPlugin": { | ||
@@ -5,0 +5,0 @@ "name": "i18n" |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11314
1