{"_id":"koa-locale","_rev":"14-acab60b8f9ac7fbc5f01e7c6f8f64278","name":"koa-locale","description":"Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.","dist-tags":{"latest":"1.3.0"},"versions":{"0.1.0":{"name":"koa-locale","version":"0.1.0","description":"Get locale variable from query, subdomain, accept-languages or cookie for koa.","main":"index.js","scripts":{"test":"make test"},"keywords":["koa","locale","i18n","lang"],"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"license":"MIT","devDependencies":{"koa":"^0.5.2","koa-compose":"^2.2.0","mocha":"^1.18.2","should":"^3.2.0","supertest":"^0.10.0"},"dependencies":{"delegates":"0.0.3"},"repository":{"type":"git","url":"http://github.com/fundon/koa-locale.git"},"bugs":{"url":"https://github.com/fundon/koa-locale/issues"},"homepage":"https://github.com/fundon/koa-locale","_id":"koa-locale@0.1.0","dist":{"shasum":"a38d53aa19dd8aac2aa193e187bfd75122148908","tarball":"https://registry.npmjs.org/koa-locale/-/koa-locale-0.1.0.tgz","integrity":"sha512-ZZnTmuz7VA1DVdW1CsKXI/BVlTlmcbiDYO45yB18Rn4uIfhEC6B4g8cFzDBTjHx+9miP8hjuf/wCnNK8406MSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBROPnbF45RjqUs4MIOgcRnCP35WYUMfXndgvI547stwAiBbX2BfFKOH7BpE8Bmn2x6uGLxcyRLtbt9HOpY0/+RU7A=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"fundon","email":"cfddream@gmail.com"},"maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}]},"0.1.1":{"name":"koa-locale","version":"0.1.1","description":"Get locale variable from query, subdomain, accept-languages or cookie for koa.","main":"index.js","scripts":{"test":"make test"},"keywords":["koa","locale","i18n","lang"],"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"license":"MIT","devDependencies":{"koa":"^0.5.2","koa-compose":"^2.2.0","mocha":"^1.18.2","should":"^3.2.0","supertest":"^0.10.0"},"dependencies":{"delegates":"0.0.3"},"repository":{"type":"git","url":"http://github.com/fundon/koa-locale.git"},"bugs":{"url":"https://github.com/fundon/koa-locale/issues"},"homepage":"https://github.com/fundon/koa-locale","_id":"koa-locale@0.1.1","dist":{"shasum":"35bdbad3ef8ce9f78bfcbd5b7d1c3cb36349ca3f","tarball":"https://registry.npmjs.org/koa-locale/-/koa-locale-0.1.1.tgz","integrity":"sha512-LqP5M/X7LwHkzXFl2KtLaUycmF6N+EBF0tehCakTrm/vvIMze9iRkIySbeKnAnwXbepAqE89VWZMEN58lpcjag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqCvUiEtgmTlUjVlFx18BuCQQ8NFqSWKkN+Pcp+QtDtAiEAnro3HLgtfzvwyTLeeg8LA1kpvOhb2yTjl+aOq1VAFsU="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"fundon","email":"cfddream@gmail.com"},"maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}]},"0.3.0":{"name":"koa-locale","version":"0.3.0","description":"Get locale variable from query, subdomain, accept-languages or cookie for koa.","main":"index.js","scripts":{"test":"make test"},"keywords":["koa","locale","i18n","L10n","lang"],"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"license":"MIT","devDependencies":{"koa":"*","koa-compose":"*","mocha":"*","should":"*","supertest":"*"},"dependencies":{"delegates":"*"},"repository":{"type":"git","url":"http://github.com/fundon/koa-locale.git"},"bugs":{"url":"https://github.com/fundon/koa-locale/issues"},"gitHead":"f8d589bb22731b65097a3c252a84b128c92649d9","homepage":"https://github.com/fundon/koa-locale","_id":"koa-locale@0.3.0","_shasum":"c41f21bd09a28b1d3694d28296a8c7c890d05fe3","_from":".","_npmVersion":"2.0.2","_nodeVersion":"0.11.14","_npmUser":{"name":"fundon","email":"cfddream@gmail.com"},"maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}],"dist":{"shasum":"c41f21bd09a28b1d3694d28296a8c7c890d05fe3","tarball":"https://registry.npmjs.org/koa-locale/-/koa-locale-0.3.0.tgz","integrity":"sha512-6gga4iFeAIZ6uc47Z5JWtSDywZD4fAgRFObt9a5MBPX/6vanrMbTFjppIO6NL1eLixUxVPJIJ5C/5b+m8ljADQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAr6I10RbPhvbGubqg4nrIrn+/2bBVxDrLhtRwDomK9WAiEAwkiMo1SLL+Pv1tpiKMNhrOmQ5WZuE+nqtrRBzOBLmtI="}]}},"1.0.0":{"name":"koa-locale","version":"1.0.0","description":"Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.","main":"index.js","scripts":{"test":"make test"},"keywords":["koa","locale","i18n","L10n","language","lang"],"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"license":"MIT","devDependencies":{"koa":"^0.18.1","koa-compose":"*","mocha":"^2.2.0","should":"^5.1.0","supertest":"*"},"dependencies":{"delegates":"*"},"repository":{"type":"git","url":"https://github.com/koa-modules/locale"},"files":["index.js"],"gitHead":"f8c2f9366670af3da44cc2fd6ca42a9dcf216c0f","bugs":{"url":"https://github.com/koa-modules/locale/issues"},"homepage":"https://github.com/koa-modules/locale","_id":"koa-locale@1.0.0","_shasum":"2871abe4840bd34073dad9e43e369c920c79820a","_from":".","_npmVersion":"2.6.0","_nodeVersion":"1.2.0","_npmUser":{"name":"fundon","email":"cfddream@gmail.com"},"maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}],"dist":{"shasum":"2871abe4840bd34073dad9e43e369c920c79820a","tarball":"https://registry.npmjs.org/koa-locale/-/koa-locale-1.0.0.tgz","integrity":"sha512-AFO2d8Zn141HQGGsw3hxDZAn+0JAFi/zMDSNIwp2ufhqjGK0IRL8gtJ5YG8F+Xh8MnkR5C9k+psMeu/keN12HA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDt3okfNeONdrmBGXubnm2P0T0cOfraSv9AEhWw9UyM8gIhAL8Jd1Yl9nT/IpqCyx3YwaFL02i/DPfP68gB2zMaMjW+"}]}},"1.1.0":{"name":"koa-locale","version":"1.1.0","description":"Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.","main":"index.js","scripts":{"test":"mocha --harmony --reporter spec --bail --check-leaks","test-ci":"istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/*.js","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/*.js"},"keywords":["koa","locale","i18n","L10n","language","lang"],"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"license":"MIT","devDependencies":{"bluebird":"3.4.0","istanbul":"0.4.3","koa":"1.2.0","koa-compose":"2.4.0","mocha":"2.4.5","should":"8.3.2","supertest":"1.2.0"},"dependencies":{"delegates":"1.0.0"},"repository":{"type":"git","url":"git+https://github.com/koa-modules/locale.git"},"files":["index.js"],"gitHead":"415156787d4470263614a981f866e090a63da405","bugs":{"url":"https://github.com/koa-modules/locale/issues"},"homepage":"https://github.com/koa-modules/locale#readme","_id":"koa-locale@1.1.0","_shasum":"8e0ec6049da9422bc459487f5a1667fff15fe3b2","_from":".","_npmVersion":"3.8.8","_nodeVersion":"6.0.0","_npmUser":{"name":"fundon","email":"cfddream@gmail.com"},"dist":{"shasum":"8e0ec6049da9422bc459487f5a1667fff15fe3b2","tarball":"https://registry.npmjs.org/koa-locale/-/koa-locale-1.1.0.tgz","integrity":"sha512-NkX4pOwhHZrrxnUz0/QKyVweZSAVeB3gbRfeSw2XoieI5C0zNMJ+2wFhnI6mVHXEph+Y+iVtiXCxc4CM+S7Ksg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDkkBxVJNJYJbKYhrJTwgcS92JQmarHMPhEf7U09S8kLAiBPq587mDsghy+79vrYDZ04HBg7c12jlw96d2RPqnet0w=="}]},"maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/koa-locale-1.1.0.tgz_1463728404490_0.3098426491487771"}},"1.2.0":{"name":"koa-locale","version":"1.2.0","description":"Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.","main":"index.js","scripts":{"test":"mocha --harmony --reporter spec --bail --check-leaks","test-ci":"istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/*.js","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/*.js"},"keywords":["koa","locale","i18n","L10n","language","lang"],"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"license":"MIT","devDependencies":{"bluebird":"3.4.0","istanbul":"0.4.3","koa":"1.2.0","koa-compose":"2.4.0","mocha":"2.4.5","should":"8.3.2","supertest":"1.2.0"},"dependencies":{"delegates":"1.0.0"},"repository":{"type":"git","url":"git+https://github.com/koa-modules/locale.git"},"files":["index.js"],"gitHead":"c9707f2d1c1e40eded1315e97d314142c999f0c0","bugs":{"url":"https://github.com/koa-modules/locale/issues"},"homepage":"https://github.com/koa-modules/locale#readme","_id":"koa-locale@1.2.0","_shasum":"ad74390a58bec25d8058458394df1d001afdfb19","_from":".","_npmVersion":"3.9.6","_nodeVersion":"6.2.2","_npmUser":{"name":"fundon","email":"cfddream@gmail.com"},"dist":{"shasum":"ad74390a58bec25d8058458394df1d001afdfb19","tarball":"https://registry.npmjs.org/koa-locale/-/koa-locale-1.2.0.tgz","integrity":"sha512-7LGLzZVQ39jNGtSBry4lCAOa/R9iFlng++R1vlNTLDsF23EPguysWB5RmTpv5L5glMors/FziXEcKVG4eBKBtQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1oKeKkMLAO00WRSrLO0srCoX3lCmu/ss3Z0w0IOoCRAiEApzCJ4+YmumEvoc5B6W6mHqzldXWk7zD7/c5f8lpbIG8="}]},"maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/koa-locale-1.2.0.tgz_1466977947566_0.17439713142812252"}},"1.3.0":{"name":"koa-locale","version":"1.3.0","description":"Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks","test-ci":"istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/*.js","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/*.js"},"keywords":["koa","locale","i18n","L10n","language","lang"],"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"license":"MIT","devDependencies":{"bluebird":"^3.5.0","istanbul":"^0.4.5","koa":"^2.2.0","koa-compose":"^3.2.1","mocha":"^3.2.0","should":"^11.2.1","supertest":"^3.0.0"},"dependencies":{"delegates":"1.0.0"},"repository":{"type":"git","url":"git+https://github.com/koa-modules/locale.git"},"files":["index.js"],"gitHead":"cf0c24032ba3b51c73d0d8c05d1754a3b6359d9e","bugs":{"url":"https://github.com/koa-modules/locale/issues"},"homepage":"https://github.com/koa-modules/locale#readme","_id":"koa-locale@1.3.0","_shasum":"95289ae6fa4098804a1ee8aadd46b0af1c82cbcb","_from":".","_npmVersion":"4.3.0","_nodeVersion":"7.8.0","_npmUser":{"name":"fundon","email":"cfddream@gmail.com"},"dist":{"shasum":"95289ae6fa4098804a1ee8aadd46b0af1c82cbcb","tarball":"https://registry.npmjs.org/koa-locale/-/koa-locale-1.3.0.tgz","integrity":"sha512-90g3/l0Xv44AiHKIXRS6oglMnFNF3c2Z/ycipVqVC5NAbC3qG5mOvjlHX+weCqxiZ5DTc8TiIgjWseiUD31Y+A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDijkJc3whH3c/G+AreABp2UKsQaH8Cx2m7a0+SRo/eAAIhAKjHAzvyEh5aeFzv4bao0cSdli4pbuvCFJEE1w4EJ63g"}]},"maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/koa-locale-1.3.0.tgz_1491959900851_0.28649981948547065"}}},"readme":"# koa-locale\n\n> Get locale variable from query, subdomain, the last domain, accept-languages or cookie for koa.\n\n[![NPM version][npm-img]][npm-url]\n[![Build status][travis-img]][travis-url]\n[![Test coverage][coveralls-img]][coveralls-url]\n[![License][license-img]][license-url]\n[![Dependency status][david-img]][david-url]\n\n### Installation\n\n```bash\n$ npm install koa-locale\n```\n\n### Usage\n\n```js\nvar app = require('koa')();\nvar locale = require('koa-locale');\n\n// the locale key name defaults to `locale`\nlocale(app, 'language');\n\napp.use(function *(next) {\n  // query: '?language=en'\n  this.body = this.getLocaleFromQuery();\n});\n```\n\n### API\n\n#### ctx.getLocaleFromQuery(), ctx.request.getLocaleFromQuery()\n\n```\n/?locale=en-US\n```\n\n#### ctx.getLocaleFromSubdomain(), ctx.request.getLocaleFromSubdomain()\n\n```\nzh-CN.koajs.com\n```\n\n#### ctx.getLocaleFromHeader(multi = false), ctx.request.getLocaleFromHeader(multi = false)\n\n```\nAccept-Language: zh-CN,zh;q=0.5\n```\n\n#### ctx.getLocaleFromCookie(), ctx.request.getLocaleFromCookie()\n\n```\nCookie: locale=zh-TW\n```\n\n#### ctx.getLocaleFromUrl(options), ctx.request.getLocaleFromUrl(options)\n\n```\nhttp://koajs.com/en\n```\n\n```\noptions = { offset: 2 }\n\nhttp://koajs.com/foo/bar/en\n```\n\n#### ctx.getLocaleFromTLD(), ctx.request.getLocaleFromTLD()\n\n```\nhttp://koajs.com/\nhttp://koajs.cn/\nhttp://koajs.it/\n```\n\n### License\n\n  MIT\n\n[npm-img]: https://img.shields.io/npm/v/koa-locale.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/koa-locale\n[travis-img]: https://img.shields.io/travis/koa-modules/locale.svg?style=flat-square\n[travis-url]: https://travis-ci.org/koa-modules/locale\n[coveralls-img]: https://img.shields.io/coveralls/koa-modules/locale.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/koa-modules/locale?branch=master\n[license-img]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square\n[license-url]: LICENSE\n[david-img]: https://img.shields.io/david/koa-modules/locale.svg?style=flat-square\n[david-url]: https://david-dm.org/koa-modules/locale\n","maintainers":[{"name":"fundon","email":"cfddream@gmail.com"}],"time":{"modified":"2022-06-19T09:19:49.505Z","created":"2014-03-30T07:32:13.027Z","0.1.0":"2014-03-30T07:32:13.027Z","0.1.1":"2014-03-30T08:08:41.202Z","0.3.0":"2014-12-16T08:42:58.736Z","1.0.0":"2015-03-08T16:30:40.517Z","1.1.0":"2016-05-20T07:13:29.203Z","1.2.0":"2016-06-26T21:52:28.167Z","1.3.0":"2017-04-12T01:18:22.826Z"},"homepage":"https://github.com/koa-modules/locale#readme","keywords":["koa","locale","i18n","L10n","language","lang"],"repository":{"type":"git","url":"git+https://github.com/koa-modules/locale.git"},"author":{"name":"Fangdun Cai","email":"cfddream@gmail.com"},"bugs":{"url":"https://github.com/koa-modules/locale/issues"},"license":"MIT","readmeFilename":"README.md","users":{"oleg_tsyba":true}}