next-i18next
Advanced tools
Comparing version 0.13.0 to 0.14.0
@@ -10,4 +10,2 @@ "use strict"; | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread")); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
@@ -31,3 +29,3 @@ | ||
var _urlParse = _interopRequireDefault(require("url-parse")); | ||
var _urijs = _interopRequireDefault(require("urijs")); | ||
@@ -83,8 +81,5 @@ /* | ||
if (localeSubpaths && lng && lng !== defaultLanguage) { | ||
var url = new _urlParse.default(href, true); | ||
url.set('query', (0, _objectSpread2.default)({}, url.query, { | ||
lng: lng | ||
})); | ||
var hrefWithLang = (0, _urijs.default)(href).addQuery('lng', lng).normalizeQuery().toString(); | ||
return _react.default.createElement(_link.default, { | ||
href: url.href, | ||
href: hrefWithLang, | ||
as: "/".concat(lng).concat(as || href) | ||
@@ -91,0 +86,0 @@ }, children); |
@@ -19,2 +19,3 @@ "use strict"; | ||
combinedConfig.allLanguages = combinedConfig.otherLanguages.concat([combinedConfig.defaultLanguage]); | ||
combinedConfig.ns = [combinedConfig.defaultNS]; | ||
@@ -21,0 +22,0 @@ if (_detectNode.default && !process.browser) { |
@@ -23,3 +23,5 @@ "use strict"; | ||
localeSubpaths = config.localeSubpaths; | ||
server.use(_i18nextExpressMiddleware.default.handle(i18n)); | ||
server.use(_i18nextExpressMiddleware.default.handle(i18n, { | ||
ignoreRoutes: ['/_next', '/static'] | ||
})); | ||
@@ -26,0 +28,0 @@ if (localeSubpaths) { |
@@ -14,3 +14,3 @@ "use strict"; | ||
if (!allLanguages.includes(currentLanguage)) { | ||
return currentRoute; | ||
throw new Error('Invalid configuration: Current language is not included in all languages array'); | ||
} | ||
@@ -17,0 +17,0 @@ |
{ | ||
"name": "next-i18next", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"main": "dist/index.js", | ||
@@ -24,12 +24,16 @@ "repository": "git@github.com:isaachinman/next-i18next.git", | ||
"start": "babel-node ./src/index.js", | ||
"lint": "eslint src", | ||
"lint:fix": "eslint src --fix", | ||
"lint": "eslint src __tests__", | ||
"lint:fix": "eslint src __tests__ --fix", | ||
"build": "babel src --out-dir dist", | ||
"prepare": "yarn build", | ||
"run-example": "yarn build && cd example && rm -rf node_modules && yarn && yarn dev", | ||
"run-example:prod": "yarn build && cd example && rm -rf node_modules && yarn && yarn build && yarn start" | ||
"run-example:prod": "yarn build && cd example && rm -rf node_modules && yarn && yarn build && yarn start", | ||
"test": "NODE_ENV=test jest", | ||
"contributors:check": "all-contributors check", | ||
"contributors:add": "all-contributors add", | ||
"contributors:generate": "all-contributors generate" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "yarn lint" | ||
"pre-commit": "yarn lint && yarn test" | ||
} | ||
@@ -44,5 +48,10 @@ }, | ||
"@babel/preset-react": "^7.0.0", | ||
"all-contributors-cli": "^5.4.1", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-jest": "^23.6.0", | ||
"babel-plugin-add-module-exports": "^1.0.0", | ||
"babel-plugin-module-resolver": "^3.1.1", | ||
"babel-plugin-transform-async-to-generator": "^6.24.1", | ||
"enzyme": "^3.8.0", | ||
"enzyme-adapter-react-16": "^1.7.1", | ||
"eslint": "^5.9.0", | ||
@@ -53,3 +62,6 @@ "eslint-config-airbnb": "^17.1.0", | ||
"eslint-plugin-react": "^7.11.1", | ||
"husky": "^1.1.4" | ||
"husky": "^1.1.4", | ||
"jest": "^23.6.0", | ||
"next": "^7.0.2", | ||
"react-dom": "^16.6.3" | ||
}, | ||
@@ -67,4 +79,4 @@ "dependencies": { | ||
"react-i18next": "^8.4.0", | ||
"url-parse": "^1.4.4" | ||
"urijs": "^1.19.1" | ||
} | ||
} |
# next-i18next | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors) | ||
@@ -163,1 +164,13 @@ [![npm version](https://badge.fury.io/js/next-i18next.svg)](https://badge.fury.io/js/next-i18next) | ||
Please do! All PRs and issues will be thoroughly reviewed. | ||
## Contributors | ||
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)): | ||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
<!-- prettier-ignore --> | ||
| [<img src="https://avatars3.githubusercontent.com/u/75311?v=4" width="100px;"/><br /><sub><b>Rob Capellini</b></sub>](https://github.com/capellini)<br />[💻](https://github.com/isaachinman/next-i18next/commits?author=capellini "Code") [⚠️](https://github.com/isaachinman/next-i18next/commits?author=capellini "Tests") | [<img src="https://avatars3.githubusercontent.com/u/608862?v=4" width="100px;"/><br /><sub><b>Alexander Kachkaev</b></sub>](https://en.kachkaev.ru)<br />[📢](#talk-kachkaev "Talks") [💬](#question-kachkaev "Answering Questions") [🤔](#ideas-kachkaev "Ideas, Planning, & Feedback") | | ||
| :---: | :---: | | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
386800
28
866
175
23
+ Addedurijs@^1.19.1
+ Addedurijs@1.19.11(transitive)
- Removedurl-parse@^1.4.4
- Removedquerystringify@2.2.0(transitive)
- Removedrequires-port@1.0.0(transitive)
- Removedurl-parse@1.5.10(transitive)