Commit Graph

5 Commits (feature-plural-translations)

Author SHA1 Message Date
闲耘™ 36bd1d5202 refact(es6): use es6 syntax.
* fixed #10, But iojs-2 not support Object.assign, so use object-assign
  shim instead for now.
* use es6 syntax.
* use eslint to instead jshint.
2015-09-20 14:56:19 +08:00
Jason Lee 58324a11ff feat: Support nested locale keys.
Example:

```js
{
  model: {
    user: {
      name: 'Real Name',
      createdAt: 'Joined At'
    }
  }
}
```

```js
ctx.__('model.user.name');
ctx.__('model.user.createdAt');
```

The before:

```js
{
  'model.user.name': 'Real Name',
  'model.user.createdAt', 'Joined At'
}
```

Benchmarks:

```
Deeps:  9
  2 tests completed.

  direct read a key x 85,993,593 ops/sec ±1.89% (96 runs sampled)
  by nested         x  4,203,837 ops/sec ±0.98% (93 runs sampled)
```
2015-09-17 18:20:10 +08:00
闲耘™ 8796cb1a3a refact(apply): apply is not too slow than direct call. fixed #2 2015-08-31 10:36:11 +08:00
闲耘™ 3039718c1b refact(endsWith): endsWith is fast than regexp 2015-08-30 20:48:36 +08:00
fengmk2 5e9a018b23 revert slice arguments to args
- revert 4ecffe8d22
- also add benchmark
2015-07-21 01:46:32 +08:00