Gathering detailed insights and metrics for koa-locales2
Gathering detailed insights and metrics for koa-locales2
npm install koa-locales2
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
2,724
Last Day
1
Last Week
3
Last Month
32
Last Year
187
NOASSERTION License
1 Stars
55 Commits
3 Watchers
1 Branches
1 Contributors
Updated on Dec 13, 2017
Latest Version
1.6.0
Package Id
koa-locales2@1.6.0
Size
4.32 kB
NPM Version
3.10.10
Node Version
6.9.5
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-66.7%
3
Compared to previous week
Last Month
146.2%
32
Compared to previous month
Last Year
13.3%
187
Compared to previous year
3
koa locales, i18n solution for koa:
options.dirs
.*.js
, *.json
and *.properties
, see examples.__(key[, value, ...])
.query
, cookie
and header: Accept-Language
.1$ npm install koa-locales --save
1var koa = require('koa'); 2var locales = require('koa-locales'); 3 4var app = koa(); 5var options = { 6 dirs: [__dirname + '/locales', __dirname + '/foo/locales'], 7}; 8locales(app, options);
locales(app, options)
Patch locales functions to koa app.
__
.['$PWD/locales']
.en-US
.locale
.locale
.1y
, expired after one year.1locales({ 2 app: app, 3 dirs: [__dirname + '/app/locales'], 4 defaultLocale: 'zh-CN', 5}));
context.__(key[, value1[, value2, ...]])
Get current request locale text.
1function* home() { 2 this.body = { 3 message: this.__('Hello, %s', 'fengmk2'), 4 }; 5}
Examples:
1__('Hello, %s. %s', 'fengmk2', 'koa rock!') 2=> 3'Hello fengmk2. koa rock!' 4 5__('{0} {0} {1} {1} {1}', ['foo', 'bar']) 6=> 7'foo foo bar bar bar' 8 9__('{a} {a} {b} {b} {b}', {a: 'foo', b: 'bar'}) 10=> 11'foo foo bar bar bar'
1this.state.__ = this.__.bind(this);
nunjucks example:
1{{ __('Hello, %s', user.name) }}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More