nuxt-i18n
Advanced tools
Comparing version 6.25.0 to 6.26.0
{ | ||
"name": "nuxt-i18n", | ||
"version": "6.25.0", | ||
"version": "6.26.0", | ||
"description": "i18n for Nuxt", | ||
@@ -107,3 +107,3 @@ "license": "MIT", | ||
"@nuxt/types": "2.15.4", | ||
"@nuxtjs/composition-api": "0.23.0", | ||
"@nuxtjs/composition-api": "0.23.2", | ||
"@nuxtjs/eslint-config-typescript": "6.0.0", | ||
@@ -126,3 +126,3 @@ "@nuxtjs/module-test-utils": "1.6.3", | ||
"codecov": "3.8.1", | ||
"core-js": "3.10.1", | ||
"core-js": "3.10.2", | ||
"eslint": "7.24.0", | ||
@@ -132,3 +132,3 @@ "express": "4.17.1", | ||
"jest": "26.6.3", | ||
"jest-dev-server": "4.4.0", | ||
"jest-dev-server": "5.0.0", | ||
"jsdom": "16.5.3", | ||
@@ -135,0 +135,0 @@ "messageformat": "2.3.0", |
@@ -24,9 +24,2 @@ import Vue from 'vue' | ||
const detectBrowserLanguage = /** @type {Required<import('../../types').DetectBrowserLanguageOptions>} */(options.detectBrowserLanguage) | ||
const { alwaysRedirect, onlyOnNoPrefix, onlyOnRoot, fallbackLocale } = detectBrowserLanguage | ||
const getLocaleFromRoute = createLocaleFromRouteGetter(options.localeCodes, { | ||
routesNameSeparator: options.routesNameSeparator, | ||
defaultLocaleRouteNameSuffix: options.defaultLocaleRouteNameSuffix | ||
}) | ||
/** @type {import('@nuxt/types').Plugin} */ | ||
@@ -40,3 +33,6 @@ export default async (context) => { | ||
if (process.server && options.lazy) { | ||
const { lazy } = options | ||
const injectInNuxtState = lazy && (lazy === true || lazy.skipNuxtState !== true) | ||
if (process.server && injectInNuxtState) { | ||
const devalue = (await import('devalue')).default | ||
@@ -63,3 +59,13 @@ context.beforeNuxtRender(({ nuxtState }) => { | ||
const { useCookie, cookieKey, cookieDomain, cookieSecure, cookieCrossOrigin } = detectBrowserLanguage | ||
const { | ||
alwaysRedirect, | ||
fallbackLocale, | ||
onlyOnNoPrefix, | ||
onlyOnRoot, | ||
useCookie, | ||
cookieKey, | ||
cookieDomain, | ||
cookieSecure, | ||
cookieCrossOrigin | ||
} = /** @type {Required<import('../../types').DetectBrowserLanguageOptions>} */(options.detectBrowserLanguage) | ||
@@ -149,2 +155,7 @@ /** | ||
const getLocaleFromRoute = createLocaleFromRouteGetter(options.localeCodes, { | ||
routesNameSeparator: options.routesNameSeparator, | ||
defaultLocaleRouteNameSuffix: options.defaultLocaleRouteNameSuffix | ||
}) | ||
/** | ||
@@ -151,0 +162,0 @@ * Gets the redirect path for locale. |
@@ -44,2 +44,6 @@ import VueI18n, { Locale, I18nOptions, IVueI18n } from 'vue-i18n' | ||
export interface LazyOptions { | ||
skipNuxtState?: boolean | ||
} | ||
// Options that are also exposed on the VueI18n instance. | ||
@@ -60,3 +64,3 @@ export interface BaseOptions { | ||
langDir?: string | null | ||
lazy?: boolean | ||
lazy?: boolean | LazyOptions | ||
pages?: { | ||
@@ -63,0 +67,0 @@ [key: string]: false | { |
Sorry, the diff of this file is too big to display
2080
152622
23