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

nuxt-i18n

Package Overview
Dependencies
Maintainers
2
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-i18n - npm Package Compare versions

Comparing version 6.13.1 to 6.13.2

9

CHANGELOG.md

@@ -0,1 +1,10 @@

### [6.13.2](https://github.com/nuxt-community/i18n-module/compare/v6.13.1...v6.13.2) (2020-07-31)
### Bug Fixes
* generate fallback routes for static build ([#808](https://github.com/nuxt-community/i18n-module/issues/808)) ([c2106f7](https://github.com/nuxt-community/i18n-module/commit/c2106f7185df2329d2068582b5e5a59c371c0192)), closes [#805](https://github.com/nuxt-community/i18n-module/issues/805)
* redirect loop on initial load (static mode & route with no locale) ([4c9bc13](https://github.com/nuxt-community/i18n-module/commit/4c9bc13968c96f3abd544f3b24ef90882ea10d96)), closes [#798](https://github.com/nuxt-community/i18n-module/issues/798)
* **types:** fix type of detectBrowserLanguage to allow false ([#793](https://github.com/nuxt-community/i18n-module/issues/793)) ([c62f19b](https://github.com/nuxt-community/i18n-module/commit/c62f19b527d91658b036c15a9f86399a2deded34))
### [6.13.1](https://github.com/nuxt-community/nuxt-i18n/compare/v6.13.0...v6.13.1) (2020-07-03)

@@ -2,0 +11,0 @@

34

package.json
{
"name": "nuxt-i18n",
"version": "6.13.1",
"version": "6.13.2",
"description": "i18n for Nuxt",

@@ -16,6 +16,6 @@ "license": "MIT",

"types": "types/index.d.ts",
"repository": "https://github.com/nuxt-community/nuxt-i18n",
"homepage": "https://nuxt-community.github.io/nuxt-i18n/",
"repository": "https://github.com/nuxt-community/i18n-module",
"homepage": "https://i18n.nuxtjs.org",
"bugs": {
"url": "https://nuxtjs.cmty.io/nuxt-community/nuxt-i18n/issues"
"url": "https://github.com/nuxt-community/i18n-module/issues"
},

@@ -95,7 +95,7 @@ "publishConfig": {

"devDependencies": {
"@babel/core": "7.10.4",
"@babel/preset-env": "7.10.4",
"@babel/runtime": "7.10.4",
"@nuxt/types": "2.13.3",
"@nuxtjs/eslint-config-typescript": "2.0.0",
"@babel/core": "7.11.0",
"@babel/preset-env": "7.11.0",
"@babel/runtime": "7.11.0",
"@nuxt/types": "2.14.0",
"@nuxtjs/eslint-config-typescript": "3.0.0",
"@nuxtjs/module-test-utils": "1.6.3",

@@ -105,3 +105,3 @@ "@release-it/conventional-changelog": "1.1.4",

"@types/finalhandler": "1.1.0",
"@types/jest": "26.0.3",
"@types/jest": "26.0.8",
"@types/jest-dev-server": "4.2.0",

@@ -113,17 +113,17 @@ "@types/jsdom": "16.2.3",

"babel-eslint": "10.1.0",
"codecov": "3.7.0",
"codecov": "3.7.2",
"core-js": "3.6.5",
"eslint": "6.8.0",
"finalhandler": "1.1.2",
"jest": "26.1.0",
"jest": "26.2.2",
"jest-dev-server": "4.4.0",
"jsdom": "16.2.2",
"jsdom": "16.3.0",
"messageformat": "2.3.0",
"nuxt": "2.13.3",
"playwright-chromium": "1.1.1",
"release-it": "13.6.4",
"nuxt": "2.14.0",
"playwright-chromium": "1.2.1",
"release-it": "13.6.6",
"serve-static": "1.14.1",
"typescript": "3.9.6",
"typescript": "3.9.7",
"vuepress": "1.5.2"
}
}

@@ -1,8 +0,10 @@

# nuxt-i18n
<p align="center">
<img width="300" height="270" src="./assets/nuxt-i18n-logo.png" alt="nuxt-i18n logo">
<h2 align="center">nuxt-i18n</h2>
</p>
[![](https://david-dm.org/nuxt-community/nuxt-i18n/status.svg?style=flat-square)](https://david-dm.org/nuxt-community/nuxt-i18n)
[![](https://david-dm.org/nuxt-community/i18n-module/status.svg?style=flat-square)](https://david-dm.org/nuxt-community/i18n-module)
[![](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com)
[![](https://img.shields.io/circleci/project/github/nuxt-community/nuxt-i18n.svg?style=flat-square)](https://circleci.com/gh/nuxt-community/nuxt-i18n)
[![](https://img.shields.io/codecov/c/github/nuxt-community/nuxt-i18n.svg?style=flat-square)](https://codecov.io/gh/nuxt-community/nuxt-i18n)
[![](https://snyk.io/test/github/nuxt-community/nuxt-i18n/badge.svg?style=flat-square)](https://snyk.io/test/github/nuxt-community/nuxt-i18n)
[![](https://img.shields.io/codecov/c/github/nuxt-community/i18n-module.svg?style=flat-square)](https://codecov.io/gh/nuxt-community/i18n-module)
[![](https://snyk.io/test/github/nuxt-community/i18n-module/badge.svg?style=flat-square)](https://snyk.io/test/github/nuxt-community/i18n-module)
[![](https://img.shields.io/npm/v/nuxt-i18n/latest.svg?style=flat-square)](https://npmjs.com/package/nuxt-i18n)

@@ -14,5 +16,5 @@ [![](https://img.shields.io/npm/dt/nuxt-i18n.svg?style=flat-square)](https://npmjs.com/package/nuxt-i18n)

## Links
- [Documentation](https://nuxt-community.github.io/nuxt-i18n/)
- [Release notes](./CHANGELOG.md)
- [Community](https://discord.nuxtjs.org/)
- 📘 [Documentation](https://i18n.nuxtjs.org/)
- 🔖 [Release notes](./CHANGELOG.md)
- 👥 [Community](https://discord.nuxtjs.org/)

@@ -89,3 +91,3 @@

If you would like to find out more about how to use `nuxt-i18n`, [check out the docs](https://nuxt-community.github.io/nuxt-i18n/)!
If you would like to find out more about how to use `nuxt-i18n`, [check out the docs](https://i18n.nuxtjs.org/)!

@@ -101,4 +103,4 @@ ## Contributing

mkdir modules
git clone git@github.com:<username>/nuxt-i18n.git modules/nuxt-i18n # ssh
git clone https://github.com/<username>/nuxt-i18n.git modules/nuxt-i18n # https
git clone git@github.com:<username>/i18n-module.git modules/i18n-module # ssh
git clone https://github.com/<username>/i18n-module.git modules/i18n-module # https
```

@@ -113,3 +115,3 @@

modules: [
['./modules/nuxt-i18n', {
['./modules/i18n-module', {
// options...

@@ -124,3 +126,3 @@ }]

```sh
cd modules/nuxt-i18n/
cd modules/i18n-module/
yarn # yarn

@@ -152,4 +154,4 @@ npm i # npm

```sh
git clone git@github.com:<username>/nuxt-i18n.git # ssh
git clone https://github.com/<username>/nuxt-i18n.git # https
git clone git@github.com:<username>/i18n-module.git # ssh
git clone https://github.com/<username>/i18n-module.git # https
```

@@ -160,3 +162,3 @@

```sh
cd nuxt-i18n
cd i18n-module
yarn # yarn

@@ -163,0 +165,0 @@ npm i # npm

@@ -5,3 +5,3 @@ const { readFileSync } = require('fs')

// Must not be an explicit dependency to avoid version mismatch issue.
// See https://github.com/nuxt-community/nuxt-i18n/issues/297
// See https://github.com/nuxt-community/i18n-module/issues/297
const compiler = require('vue-template-compiler')

@@ -8,0 +8,0 @@ const { COMPONENT_OPTIONS_KEY, MODULE_NAME } = require('./constants')

@@ -9,3 +9,3 @@ const { STRATEGIES } = require('./constants')

differentDomains,
isNuxtGenerate,
includeUprefixedFallback,
locales,

@@ -134,3 +134,3 @@ pages,

if (shouldAddPrefix && isDefaultLocale && strategy === STRATEGIES.PREFIX && isNuxtGenerate) {
if (shouldAddPrefix && isDefaultLocale && strategy === STRATEGIES.PREFIX && includeUprefixedFallback) {
routes.push({

@@ -137,0 +137,0 @@ path: route.path,

@@ -59,3 +59,6 @@ const { resolve, join } = require('path')

if (localeCodes.length) {
let isNuxtGenerate = false
let includeUprefixedFallback = this.options.target === 'static'
// Doesn't seem like we can tell whether we are in nuxt generate from the module so we'll
// take advantage of the 'generate:before' hook to store variable.
this.nuxt.hook('generate:before', () => { includeUprefixedFallback = true })
const extendRoutes = routes => {

@@ -70,3 +73,3 @@ // This import (or more specifically 'vue-template-compiler' in helpers/components.js) needs to

pagesDir,
isNuxtGenerate,
includeUprefixedFallback,
trailingSlash

@@ -78,5 +81,2 @@ })

// Doesn't seem like we can tell whether we are in nuxt generate from the module so we'll
// take advantage of the 'generate:before' hook to store variable.
this.nuxt.hook('generate:before', () => { isNuxtGenerate = true })
this.extendRoutes(extendRoutes)

@@ -91,3 +91,3 @@ }

// eslint-disable-next-line no-console
console.warn('[' + options.MODULE_NAME + '] The `forwardedHost` option is deprecated. You can safely remove it. See: https://github.com/nuxt-community/nuxt-i18n/pull/630.')
console.warn('[' + options.MODULE_NAME + '] The `forwardedHost` option is deprecated. You can safely remove it. See: https://github.com/nuxt-community/i18n-module/pull/630.')
}

@@ -94,0 +94,0 @@

@@ -121,7 +121,8 @@ import Vue from 'vue'

redirectPath = app.localePath(route.fullPath, locale)
if (redirectPath === route.fullPath) {
return ''
}
}
if (redirectPath === route.fullPath) {
return ''
}
return redirectPath

@@ -128,0 +129,0 @@ }

@@ -124,3 +124,3 @@ import './middleware'

const isHTTPS = require('is-https')
protocol = isHTTPS(this.req) ? 'https' : 'http'
protocol = (this.req && isHTTPS(this.req)) ? 'https' : 'http'
} else {

@@ -127,0 +127,0 @@ protocol = window.location.protocol.split(':')[0]

@@ -88,4 +88,10 @@ import Cookie from 'cookie'

export const getLocaleDomain = (locales, req, { localDomainKey, localeCodeKey }) => {
const hostname = process.client ? window.location.hostname : (req.headers['x-forwarded-host'] || req.headers.host)
let hostname = null
if (process.client) {
hostname = window.location.hostname
} else if (req) {
hostname = req.headers['x-forwarded-host'] || req.headers.host
}
if (hostname) {

@@ -92,0 +98,0 @@ const localeDomain = locales.find(l => l[localDomainKey] === hostname)

@@ -61,6 +61,6 @@ import VueI18n from 'vue-i18n'

// see options reference: https://github.com/nuxt-community/nuxt-i18n/blob/master/docs/options-reference.md
// see options reference: https://github.com/nuxt-community/i18n-module/blob/master/docs/options-reference.md
interface AllOptionsInterface extends NuxtI18nInterface {
baseUrl?: string | ((context: NuxtContext) => string)
detectBrowserLanguage?: DetectBrowserLanguageInterface
detectBrowserLanguage?: DetectBrowserLanguageInterface | false
langDir?: string | null

@@ -67,0 +67,0 @@ lazy?: boolean

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