Release 1.7.0

master 1.7.0
fengmk2 2017-04-27 16:17:22 +08:00
parent c46d049a5e
commit 043fab2b97
3 changed files with 17 additions and 12 deletions

View File

@ -1,4 +1,9 @@
1.7.0 / 2017-04-27
==================
* feat: Add more debug information on a 'silly' level
1.6.0 / 2017-04-27
==================

View File

@ -23,11 +23,11 @@ $ npm install koa-locales --save
## Quick start
```js
var koa = require('koa');
var locales = require('koa-locales');
const koa = require('koa');
const locales = require('koa-locales');
var app = koa();
var options = {
const app = koa();
const options = {
dirs: [__dirname + '/locales', __dirname + '/foo/locales'],
};
locales(app, options);
@ -63,10 +63,10 @@ The key `options.localeAlias` allows to not repeat dictionary files, as you can
```js
locales({
localeAlias: {
es: es_ES,
en: en_UK
}
localeAlias: {
es: es_ES,
en: en_UK,
},
});
```
@ -122,8 +122,8 @@ You can set the property *locals* on the KoaPug instance, where the default loca
```js
app.use(async (ctx, next) => {
koaPug.locals.__ = ctx.__.bind(ctx);
await next()
koaPug.locals.__ = ctx.__.bind(ctx);
await next();
});
```
@ -162,4 +162,4 @@ Use this level if something doesn't work as you expect. This is going to debug e
[david-image]: https://img.shields.io/david/koajs/locales.svg?style=flat-square
[david-url]: https://david-dm.org/koajs/locales
[download-image]: https://img.shields.io/npm/dm/koa-locales.svg?style=flat-square
[download-url]: https://npmjs.org/package/koa-locales
[download-url]: https://npmjs.org/package/koa-locales

View File

@ -1,6 +1,6 @@
{
"name": "koa-locales",
"version": "1.6.0",
"version": "1.7.0",
"description": "koa locales, i18n solution for koa",
"main": "index.js",
"files": [