Socket
Socket
Sign inDemoInstall

next-i18next

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-i18next - npm Package Compare versions

Comparing version 0.10.0 to 0.10.1

20

dist/components/Link.js

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

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread"));
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

@@ -29,2 +31,4 @@

var _urlParse = _interopRequireDefault(require("url-parse"));
/*

@@ -67,2 +71,3 @@ This `Link` component is a wrap of the standard

var _this$props = this.props,
as = _this$props.as,
children = _this$props.children,

@@ -79,5 +84,9 @@ href = _this$props.href;

if (localeSubpaths && lng && lng !== defaultLanguage) {
var url = new _urlParse.default(href, true);
url.set('query', (0, _objectSpread2.default)({}, url.query, {
lng: lng
}));
return _react.default.createElement(_link.default, {
href: "".concat(href, "?lng=").concat(lng),
as: "/".concat(lng).concat(href)
href: url.href,
as: "/".concat(lng).concat(as || href)
}, children);

@@ -87,3 +96,4 @@ }

return _react.default.createElement(_link.default, {
href: href
href: href,
as: as
}, children);

@@ -96,4 +106,8 @@ }

Link.propTypes = {
as: _propTypes.default.string,
children: _propTypes.default.node.isRequired,
href: _propTypes.default.string.isRequired
};
Link.defaultProps = {
as: undefined
/*

@@ -100,0 +114,0 @@ Usage of `withNamespaces` here is just to

5

dist/middlewares/next-i18next-middleware.js

@@ -14,2 +14,4 @@ "use strict";

var _url = require("url");
function _default(nexti18next, app, server) {

@@ -27,3 +29,4 @@ var config = nexti18next.config,

var lng = req.params.lng;
app.render(req, res, req.url.replace("/".concat(lng), ''), {
var url = (0, _url.parse)(req.url).pathname;
app.render(req, res, url.replace("/".concat(lng), ''), {
lng: lng

@@ -30,0 +33,0 @@ });

{
"name": "next-i18next",
"version": "0.10.0",
"version": "0.10.1",
"main": "dist/index.js",

@@ -64,4 +64,5 @@ "repository": "git@github.com:isaachinman/next-i18next.git",

"react-i18next": "^8.3.8",
"react-tree-walker": "^4.3.0"
"react-tree-walker": "^4.3.0",
"url-parse": "^1.4.4"
}
}

@@ -29,7 +29,8 @@ # next-i18next

.
├── static
├── en
| └── common.json
└── de
└── common.json
└── static
└── locales
├── en
| └── common.json
└── de
└── common.json
```

@@ -154,2 +155,2 @@

Please do! All PRs and issues will be thoroughly reviewed.
Please do! All PRs and issues will be thoroughly reviewed.

Sorry, the diff of this file is not supported yet

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