Commit Graph

27 Commits (master)

Author SHA1 Message Date
Eric Chan 3db636481a Add YAML Support 2019-08-14 10:45:03 -07:00
fengmk2 47162d3230 feat: gettext from app (#38)
```js
app.__(locale, text, value);
```
2019-06-16 21:52:00 +08:00
Yiyu He 0767037b3c
feat: ctx.__setLocale (#36) 2019-04-30 20:11:00 +08:00
Yiyu He 3043365e09 feat: add __getLocaleOrigin (#35)
* chore: test on node 12
2019-04-29 16:15:14 +08:00
fengmk2 08037ee0ae
feat: allow custom locale store cookie domain (#33)
* test: use mocha@4
2019-04-17 10:43:00 +08:00
Tao Xu f89c6755c1 feat: add writeCookie option (#28) 2018-01-12 11:45:59 +08:00
Roger Fos Soler c46d049a5e feat: Add more debug information on a 'silly' level 2017-04-27 16:11:25 +08:00
Tao Xu dddb4c0c2e feat: support header lang from localeAlias (#27) 2017-04-27 16:04:15 +08:00
fengmk2 6857227777 Release 1.5.2 2017-01-13 14:39:35 +08:00
fengmk2 1f485fde83 fix: make sure signed=false on set/get cookie (#24) 2017-01-13 14:38:13 +08:00
ermin.zem ec48f1f20c feat: add localeAlias options 2016-03-16 20:10:34 +08:00
ermin.zem c45be8b6ea fix: return empty if the key-value is empty value
PR-URL: https://github.com/koajs/locales/pull/17
Reviewed-By: fengmk2 <fengmk2@gmail.com>
Reviewed-By: dead-horse <heyiyu.deadhorse@gmail.com>
2015-12-23 10:45:03 +08:00
fengmk2 629141717e fix: if header sent, don't set the cookie
bigpipe will fail
2015-12-09 18:23:54 +08:00
闲耘™ 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
闲耘™ cc81fbda18 refact(nested-data): transform nested data on load localization data. 2015-09-18 15:14:38 +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
Jason Lee 5ffefcc982 feat: Multiple locale paths support. 2015-09-14 17:29:46 +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
Haoliang Gao 0b387e3940 Merge pull request #3 from popomore/object
feat: paramter support object
2015-07-16 15:32:45 +08:00
popomore 757b28d170 feat: paramter support object 2015-07-15 22:25:23 +08:00
hotoo 4ecffe8d22 refact: arguments to array. 2015-05-21 08:39:30 +08:00
hotoo 41b16b7561 optimize use regexp without caught group 2015-05-21 08:34:36 +08:00
fengmk2 a2462e6a84 feat: support *.properties resource files 2015-05-17 21:54:12 +08:00
fengmk2 20d513f0a3 Optimization killers
see https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments
2015-05-16 22:21:00 +08:00
fengmk2 15864d180d first commit 2015-05-16 22:06:49 +08:00