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.16 to 0.0.17

4

lib/index.js

@@ -46,2 +46,5 @@ 'use strict';

options = options || {};
if (typeof options !== 'object' && i18next.options.overloadTranslationOptionHandler && typeof i18next.options.overloadTranslationOptionHandler === 'function') {
options = i18next.options.overloadTranslationOptionHandler(arguments);
}
options.lng = options.lng || req.lng;

@@ -76,2 +79,3 @@ return i18next.t(key, options);

res.locals.language = lng;
res.locals.languageDir = i18next.dir(lng);
}

@@ -78,0 +82,0 @@

@@ -14,2 +14,6 @@ 'use strict';

var parts = req.originalUrl.split('/');
if (parts[0] === '') {
// Handle paths that start with a slash, i.e., '/foo' -> ['', 'foo']
parts.shift();
}

@@ -16,0 +20,0 @@ if (parts.length > options.lookupFromPathIndex) {

2

package.json
{
"name": "i18next-express-middleware",
"version": "0.0.16",
"version": "0.0.17",
"description": "express middleware for i18next",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -105,3 +105,3 @@ # Introduction

i18next
.use(middleware.LngDetector)
.use(middleware.LanguageDetector)
.init({

@@ -116,3 +116,3 @@ detection: options

var middleware = require('i18next-express-middleware');
var lngDetector = new middleware.LngDetector(null, options);
var lngDetector = new middleware.LanguageDetector(null, options);
```

@@ -125,3 +125,3 @@

var lngDetector = new middleware.LngDetector();
var lngDetector = new middleware.LanguageDetector();
lngDetector.init(options);

@@ -159,3 +159,3 @@ ```

var lngDetector = new middleware.LngDetector();
var lngDetector = new middleware.LanguageDetector();
lngDetector.addDetector(myDetector);

@@ -162,0 +162,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