feat: add __getLocaleOrigin (#35)

* chore: test on node 12
This commit is contained in:
Yiyu He
2019-04-29 16:15:14 +08:00
committed by fengmk2
parent 86514e3f97
commit 3043365e09
6 changed files with 56 additions and 4 deletions

View File

@@ -99,6 +99,14 @@ __('{a} {a} {b} {b} {b}', {a: 'foo', b: 'bar'})
'foo foo bar bar bar'
```
### `context.__getLocale()`
Get locale from query / cookie and header.
### `context.__getLocaleOrigin()`
Where does locale come from, could be `query`, `cookie`, `header` and `default`.
## Usage on template
```js