Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ladjs/i18n

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ladjs/i18n - npm Package Compare versions

Comparing version 0.0.8 to 0.1.0

8

lib/index.js

@@ -102,2 +102,8 @@ 'use strict';

// expose a helper function to `ctx.state.l`
// which prefixes a link/path with the locale
ctx.state.l = (path = '') => {
return `/${ctx.state.locale}${path}`;
};
// override the existing locale detection with our own

@@ -199,2 +205,2 @@ // in order of priority:

module.exports = I18N;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJyZXF1aXJlIiwiZXh0bmFtZSIsInJlc29sdmUiLCJpc0VtcHR5Iiwic29ydEJ5IiwiZXZlcnkiLCJzdHJpbmdpZnkiLCJCb29tIiwicyIsImdldExhbmd1YWdlIiwibW9tZW50IiwiaTE4biIsImxvY2FsZXMiLCJhdXRvQmluZCIsImFwaSIsIkkxOE4iLCJjb25zdHJ1Y3RvciIsImNvbmZpZyIsIk9iamVjdCIsImFzc2lnbiIsInBocmFzZXMiLCJsb2dnZXIiLCJjb25zb2xlIiwiZGlyZWN0b3J5IiwiY29va2llIiwiaW5kZW50IiwiZGVmYXVsdExvY2FsZSIsInN5bmNGaWxlcyIsImF1dG9SZWxvYWQiLCJ1cGRhdGVGaWxlcyIsIl9fIiwiX19uIiwiX19sIiwiX19oIiwiX19tZiIsInJlZ2lzdGVyIiwibG9nRGVidWdGbiIsImRlYnVnIiwibG9nV2FybkZuIiwid2FybiIsImxvZ0Vycm9yRm4iLCJlcnJvciIsImwiLCJpbmNsdWRlcyIsIkVycm9yIiwiZmlsdGVyIiwic3RyIiwiam9pbiIsImNvbmZpZ3VyZSIsInRyYW5zbGF0ZSIsImtleSIsImxvY2FsZ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WRpcmVjdCk7XG4gICAgfVxuXG4gICAgLy8gc2V0IHRoZSBjb29raWUgZm9yIGZ1dHVyZSByZXF1ZXN0c1xuICAgIGN0eC5jb29raWVzLnNldCh0aGlzLmNvbmZpZy5jb29raWUsIGxvY2FsZSwge1xuICAgICAgc2lnbmVkOiB0cnVlLFxuICAgICAgZXhwaXJlczogbW9tZW50KClcbiAgICAgICAgLmFkZCgxLCAneWVhcicpXG4gICAgICAgIC50b0RhdGUoKVxuICAgIH0pO1xuXG4gICAgLy8gaWYgdGhlIHVzZXIgaXMgbG9nZ2VkIGluLCB0aGVuIHNhdmUgaXQgYXMgYGxhc3RfbG9jYWxlYFxuICAgIGlmIChjdHguaXNBdXRoZW50aWNhdGVkKCkpIHtcbiAgICAgIGN0eC5zdGF0ZS51c2VyLmxhc3RfbG9jYWxlID0gbG9jYWxlO1xuICAgICAgdHJ5IHtcbiAgICAgICAgYXdhaXQgY3R4LnN0YXRlLnVzZXIuc2F2ZSgpO1xuICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgIHRoaXMuY29uZmlnLmxvZ2dlci5lcnJvcihlcnIpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBuZXh0KCk7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBJMThOO1xuIl19
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJyZXF1aXJlIiwiZXh0bmFtZSIsInJlc29sdmUiLCJpc0VtcHR5Iiwic29ydEJ5IiwiZXZlcnkiLCJzdHJpbmdpZnkiLCJCb29tIiwicyIsImdldExhbmd1YWdlIiwibW9tZW50IiwiaTE4biIsImxvY2FsZXMiLCJhdXRvQmluZCIsImFwaSIsIkkxOE4iLCJjb25zdHJ1Y3RvciIsImNvbmZpZyIsIk9iamVjdCIsImFzc2lnbiIsInBocmFzZXMiLCJsb2dnZX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llYXInKVxuICAgICAgICAudG9EYXRlKClcbiAgICB9KTtcblxuICAgIC8vIGlmIHRoZSB1c2VyIGlzIGxvZ2dlZCBpbiwgdGhlbiBzYXZlIGl0IGFzIGBsYXN0X2xvY2FsZWBcbiAgICBpZiAoY3R4LmlzQXV0aGVudGljYXRlZCgpKSB7XG4gICAgICBjdHguc3RhdGUudXNlci5sYXN0X2xvY2FsZSA9IGxvY2FsZTtcbiAgICAgIHRyeSB7XG4gICAgICAgIGF3YWl0IGN0eC5zdGF0ZS51c2VyLnNhdmUoKTtcbiAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICB0aGlzLmNvbmZpZy5sb2dnZXIuZXJyb3IoZXJyKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gbmV4dCgpO1xuICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gSTE4TjtcbiJdfQ==

12

package.json
{
"name": "@ladjs/i18n",
"description": "i18n wrapper and Koa middleware for Lad",
"version": "0.0.8",
"version": "0.1.0",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",

@@ -15,3 +15,3 @@ "bugs": {

"auto-bind": "^1.1.0",
"boom": "^5.2.0",
"boom": "^7.1.1",
"country-language": "^0.1.7",

@@ -28,6 +28,6 @@ "i18n": "^0.8.3",

"devDependencies": {
"ava": "^0.22.0",
"ava": "^0.24.0",
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"codecov": "^2.3.0",
"codecov": "^3.0.0",
"cross-env": "^5.0.5",

@@ -38,7 +38,7 @@ "eslint": "^4.5.0",

"husky": "^0.14.3",
"lint-staged": "^4.0.4",
"lint-staged": "^6.0.0",
"nyc": "^11.1.0",
"prettier": "^1.6.1",
"remark-cli": "^4.0.0",
"remark-preset-github": "^0.0.6",
"remark-preset-github": "^0.0.7",
"xo": "^0.19.0"

@@ -45,0 +45,0 @@ },

@@ -78,2 +78,3 @@ # [**@ladjs/i18n**](https://github.com/ladjs/i18n)

* `ctx.state` - with all of `i18n` API methods (e.g. `ctx.req.t`, `ctx.req.tn`, ...)
* `ctx.state.l` - a shorthand method that accepts a path and returns a localized path (e.g. `ctx.state.l('/contact')` will output `/en/contact` if the locale is "en")
* `ctx.state.availableLanguages` (Array) - which is useful for adding a dropdown to select from an available language

@@ -80,0 +81,0 @@ * `ctx.state.currentLanguage` (String) - the current locale's language in native language using [country-language][]'s `getLanguage` method.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc