app/extend/context.js
changed.
Other files ignored by Codecov
test/i18n.test.js
has changed.
1 | 1 | 'use strict'; |
|
2 | 2 | ||
3 | - | const LOCALE = Symbol('context#locale'); |
|
4 | - | ||
5 | 3 | module.exports = { |
|
6 | 4 | /** |
|
7 | 5 | * get current request locale |
9 | 7 | * @return {String} lower case locale string, e.g.: 'zh-cn', 'en-us' |
|
10 | 8 | */ |
|
11 | 9 | get locale() { |
|
12 | - | if (this[LOCALE] === undefined) return this.__getLocale(); |
|
13 | - | return this[LOCALE]; |
|
10 | + | return this.__getLocale(); |
|
14 | 11 | }, |
|
15 | 12 | ||
16 | 13 | set locale(l) { |
|
17 | - | this[LOCALE] = l; |
|
14 | + | return this.__setLocale(l); |
|
18 | 15 | }, |
|
19 | 16 | }; |
Files | Coverage |
---|---|
app | 100.00% |
app.js | 100.00% |
config/config.default.js | 100.00% |
Project Totals (4 files) | 100.00% |