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

i18next-express-middleware

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-express-middleware - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

lib/LanguageDetector.js

18

lib/index.js

@@ -10,2 +10,4 @@ 'use strict';

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }

@@ -17,5 +19,13 @@

function handle(i18next, options) {
options = options || {};
var _LanguageDetector = require('./LanguageDetector');
var _LanguageDetector2 = _interopRequireDefault(_LanguageDetector);
var LanguageDetector = _LanguageDetector2['default'];
exports.LanguageDetector = LanguageDetector;
function handle(i18next) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
return function (req, res, next) {

@@ -28,3 +38,3 @@ var ignores = options.ignoreRoutes || [];

var lng = req.lng;
if (req.lng && i18next.services.languageDetector) lng = i18next.services.languageDetector.detect();
if (req.lng && i18next.services.languageDetector) lng = i18next.services.languageDetector.detect(req, res);

@@ -69,3 +79,3 @@ // set locale

if (i18next.services.languageDetector) i18next.services.languageDetector.cacheUserLanguage(lng);
if (i18next.services.languageDetector) i18next.services.languageDetector.cacheUserLanguage(req, res, lng);
next();

@@ -72,0 +82,0 @@ };

{
"name": "i18next-express-middleware",
"version": "0.0.7",
"version": "0.0.8",
"description": "express middleware for i18next",

@@ -15,2 +15,3 @@ "main": "./lib/index.js",

"dependencies": {
"cookies": "0.5.1",
"json5": "0.4.0"

@@ -17,0 +18,0 @@ },

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