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.2.0 to 0.3.2

28

lib/index.js

@@ -48,5 +48,5 @@ 'use strict';

defaultLocale: 'en',
syncFiles: boolean(process.env.I18N_SYNC_FILES),
autoReload: boolean(process.env.I18N_AUTO_RELOAD),
updateFiles: boolean(process.env.I18N_UPDATE_FILES),
syncFiles: boolean(process.env.I18N_SYNC_FILES || true),
autoReload: boolean(process.env.I18N_AUTO_RELOAD || false),
updateFiles: boolean(process.env.I18N_UPDATE_FILES || true),
api: {

@@ -85,4 +85,7 @@ __: 't',

phrases = _config.phrases;
// eslint-disable-next-line prefer-rest-params
let args = Object.keys(arguments).map(key => arguments[key]).slice(2);
let args = Object.keys(arguments)
// eslint-disable-next-line prefer-rest-params
.map(key => arguments[key]).slice(2);
if (typeof args === 'undefined') args = [];

@@ -140,2 +143,4 @@ const phrase = phrases[key];

debug('found locale via Accept-Language header using %s', locale);
} else {
debug('using default locale');
}

@@ -149,3 +154,6 @@ }

// if the locale was not available then redirect user
if (locale !== ctx.state.locale) return ctx.redirect(`/${ctx.state.locale}${ctx.pathWithoutLocale}${isEmpty(ctx.query) ? '' : `?${stringify(ctx.query)}`}`);
if (locale !== ctx.state.locale) {
debug('locale was not available redirecting user');
return ctx.redirect(`/${ctx.state.locale}${ctx.pathWithoutLocale}${isEmpty(ctx.query) ? '' : `?${stringify(ctx.query)}`}`);
}

@@ -168,6 +176,6 @@ // available languages for a dropdown menu to change language

// and then it will call `t` to translate it to the user's locale
ctx.translate = function () {
if (typeof arguments[0] !== 'string' || typeof phrases[arguments[0]] !== 'string') return ctx.throw(Boom.badRequest('Translation for your locale failed, try again'));
arguments[0] = phrases[arguments[0]];
return ctx.req.t(...arguments);
ctx.translate = function (...args) {
if (typeof args[0] !== 'string' || typeof phrases[args[0]] !== 'string') return ctx.throw(Boom.badRequest('Translation for your locale failed, try again'));
args[0] = phrases[args[0]];
return ctx.req.t(...args);
};

@@ -228,2 +236,2 @@

module.exports = I18N;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJyZXF1aXJlIiwiZXh0bmFtZSIsInJlc29sdmUiLCJzdHJpbmdpZnkiLCJCb29tIiwicyIsImlzRW1wdHkiLCJzb3J0QnkiLCJldmVyeSIsImlzRnVuY3Rpb24iLCJnZXRMYW5ndWFnZSIsIm1vbWVudCIsImkxOG4iLCJsb2NhbGVzIiwiYXV0b0JpbmQiLCJkZWJ1ZyIsImJvb2xlYW4iLCJhcGkiLCJJMThOIiwiY29uc3RydWN0b3IiLCJjb25maWciLCJPYmplY3QiLCJhc3NpZ24iLCJwaHJhc2VzIiwibG9nZ2VyIiwiY29uc29sZSIsImRpcmVjdG9yeSIsImNvb2tpZSIsImluZGVudCIsImRlZmF1bHRMb2NhbGUiLCJzeW5jRmlsZXMiLCJwcm9jZXNzIiwiZW52IiwiSTE4Tl9TWU5DX0ZJTEVTIiwiYXV0b1JlbG9hZCIsIkkxOE5fQVVUT19SRUxPQUQiLCJ1cGRhdGVGaWxlcyIsIkkxOE5fVVBEQVRFX0ZJTEVTIiwiX18iLCJfX24iLCJfX2wiLCJfX2giLCJfX21mIiwicmVnaXN0ZXIiLCJsb2dEZWJ1Z0ZuIiwibG9nV2FybkZuIiwid2FybiIsImxvZ0Vycm9yRm4iLCJlcnJvciIsImwiLCJpbmNsdWRlcyIsIkVycm9yIiwiZmlsdGVyIiwic3RyIiwiam9pbiIsImNvbmZpZ3VyZSIsInRyYW5zbGF0ZSIsImtleSIsImxvY2FsZSIsImFyZ3MiLCJrZXlzIiwiYXJndW1lbnRzIiwibWFwIiwic2xpY2UiLCJwaHJh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jdHguaXNBdXRoZW50aWNhdGVkKCkpIHtcbiAgICAgIGN0eC5zdGF0ZS51c2VyLmxhc3RfbG9jYWxlID0gbG9jYWxlO1xuICAgICAgdHJ5IHtcbiAgICAgICAgYXdhaXQgY3R4LnN0YXRlLnVzZXIuc2F2ZSgpO1xuICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgIHRoaXMuY29uZmlnLmxvZ2dlci5lcnJvcihlcnIpO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBuZXh0KCk7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBJMThOO1xuIl19
{
"name": "@ladjs/i18n",
"description": "i18n wrapper and Koa middleware for Lad",
"version": "0.2.0",
"version": "0.3.2",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",

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

"dependencies": {
"auto-bind": "^1.1.0",
"auto-bind": "^1.2.0",
"boolean": "^0.1.3",

@@ -21,28 +21,28 @@ "boom": "5.2.0",

"i18n-locales": "^0.0.2",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"qs": "^6.5.1",
"lodash": "^4.17.10",
"moment": "^2.22.1",
"qs": "^6.5.2",
"underscore.string": "^3.3.4"
},
"devDependencies": {
"ava": "^0.24.0",
"ava": "^0.25.0",
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"codecov": "^3.0.0",
"cross-env": "^5.0.5",
"babel-preset-env": "^1.7.0",
"codecov": "^3.0.2",
"cross-env": "^5.1.5",
"debug": "^3.1.0",
"eslint": "^4.5.0",
"eslint-config-prettier": "^2.3.0",
"eslint-plugin-prettier": "^2.2.0",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.0",
"husky": "^0.14.3",
"koa": "^2.4.1",
"koa-generic-session": "^2.0.0",
"lint-staged": "^6.0.0",
"nyc": "^11.1.0",
"prettier": "^1.6.1",
"remark-cli": "^4.0.0",
"remark-preset-github": "^0.0.7",
"sinon": "^4.1.3",
"supertest": "^3.0.0",
"xo": "^0.19.0"
"koa": "^2.5.1",
"koa-generic-session": "^2.0.1",
"lint-staged": "^7.1.2",
"nyc": "^11.8.0",
"prettier": "^1.12.1",
"remark-cli": "^5.0.0",
"remark-preset-github": "^0.0.8",
"sinon": "^5.0.7",
"supertest": "^3.1.0",
"xo": "^0.21.1"
},

@@ -49,0 +49,0 @@ "engines": {

@@ -112,8 +112,8 @@ # [**@ladjs/i18n**](https://github.com/ladjs/i18n)

defaultLocale: 'en',
// uses truthy `process.env.I18N_SYNC_FILES`
syncFiles: false,
// uses truthy `process.env.I18N_AUTO_RELOAD`
// `process.env.I18N_SYNC_FILES`
syncFiles: true,
// `process.env.I18N_AUTO_RELOAD`
autoReload: false,
// uses truthy `process.env.I18N_UPDATE_FILES`
updateFiles: false,
// `process.env.I18N_UPDATE_FILES`
updateFiles: true,
api: {

@@ -120,0 +120,0 @@ __: 't',

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