diff --git a/package.json b/package.json index f433be5d1..13ceefcf1 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "unplugin": "^1.3.2", "unstorage": "^1.5.0", "vue-i18n": "9.3.0-beta.26", - "vue-i18n-routing": "^0.13.3" + "vue-i18n-routing": "^0.13.4" }, "devDependencies": { "@babel/parser": "^7.22.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6832ac850..790d098ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,8 +70,8 @@ importers: specifier: 9.3.0-beta.26 version: 9.3.0-beta.26(vue@3.3.4) vue-i18n-routing: - specifier: ^0.13.3 - version: 0.13.3(vue-i18n@9.3.0-beta.26)(vue@3.3.4) + specifier: ^0.13.4 + version: 0.13.4(vue-i18n@9.3.0-beta.26)(vue@3.3.4) devDependencies: '@babel/parser': specifier: ^7.22.7 @@ -174,7 +174,7 @@ importers: devDependencies: '@nuxt/devtools': specifier: latest - version: 0.8.0(debug@4.3.4)(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7) + version: 0.7.6(debug@4.3.4)(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7) '@nuxtjs/i18n': specifier: link:.. version: link:.. @@ -1759,8 +1759,8 @@ packages: resolution: {integrity: sha512-GBzP8zOc7CGWyFQS6dv1lQz8VVpz5C2yRszbXufwG/9zhStTIH50EtD87NmWbTMwXDvZLNg8GIpb1UFdH93JCA==} dev: true - /@nuxt/devtools-kit@0.8.0(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7): - resolution: {integrity: sha512-zHwotLFwmYPFDg0JHyInn0L3i2gZK24JYDfgOzqBuvCD/Q3ytQVyAMrX2Mp4iIrHjwToZBJ0dlyV+UYXCiWwSg==} + /@nuxt/devtools-kit@0.7.6(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7): + resolution: {integrity: sha512-2jSQ1rgStZifRHtfsdqmmvq/O5NskLCwg34JPchBRAx9Kv5IadABlBIWz1jLuaGarI/jsEEAmA5EpfxI5z/PJQ==} peerDependencies: nuxt: ^3.6.5 vite: '*' @@ -1775,8 +1775,8 @@ packages: - supports-color dev: true - /@nuxt/devtools-wizard@0.8.0: - resolution: {integrity: sha512-nxYAB4TQgeaoYY3xBEzrYVpXzXUAwoeCui0vqu1oTeeuKnl62uXFGsY4vXMHQtnibvbQVZzNFVFoXggKM3MBGw==} + /@nuxt/devtools-wizard@0.7.6: + resolution: {integrity: sha512-XCznlUTk66ApYJygGc+6FVborAp2F4PAIvY4b6dVSUf1f47Hs3CPe6eEdatarmEqiTmFMInaX4y8z1hDXrFF0Q==} hasBin: true dependencies: consola: 3.2.3 @@ -1792,15 +1792,15 @@ packages: semver: 7.5.4 dev: true - /@nuxt/devtools@0.8.0(debug@4.3.4)(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7): - resolution: {integrity: sha512-w48eqZ52NLVB8C0Q1E/eY0xsokMr9diOaxUptO08UYNhyj+MKKBrhIBTePYO7GlxabXOaHM62zi+iN8AT1qXoA==} + /@nuxt/devtools@0.7.6(debug@4.3.4)(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7): + resolution: {integrity: sha512-2x/eS0KbzTCK4+OozSZTcbjndM2ySy84MltF/suwLP7Wp/ehY8vzRp+yMTksxLjsf0sbiAa4K8WJCzKd8wLXxA==} hasBin: true peerDependencies: nuxt: ^3.6.5 vite: '*' dependencies: - '@nuxt/devtools-kit': 0.8.0(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7) - '@nuxt/devtools-wizard': 0.8.0 + '@nuxt/devtools-kit': 0.7.6(nuxt@3.6.5)(rollup@3.27.0)(vite@4.4.7) + '@nuxt/devtools-wizard': 0.7.6 '@nuxt/kit': 3.6.5(rollup@3.27.0) birpc: 0.2.12 boxen: 7.1.1 @@ -10605,8 +10605,8 @@ packages: resolution: {integrity: sha512-RutnB7X8c5hjq39NceArgXg28WZtZpGc3+J16ljMiYnFhKvd8hITxSWQSQ5bvldxMDU6gG5mkxl1MTQLXckVSQ==} dev: true - /vue-i18n-routing@0.13.3(vue-i18n@9.3.0-beta.26)(vue@3.3.4): - resolution: {integrity: sha512-RdYFuo8w653yv9D6AAf0KqtwI11P1/28b3WgPKyY9Kr+QQ+du9c9HvZTP/AVh1Ag2lrfubpTmL0nyH9LHZ0cgQ==} + /vue-i18n-routing@0.13.4(vue-i18n@9.3.0-beta.26)(vue@3.3.4): + resolution: {integrity: sha512-cihM/X4c6dgAnSVoIc3wUoiGG6B/Y+a3B3+Xt+7b9n2mjnKQ+ZkQ6oKVQxOd8WFRdJyohlP5dyL3Xsho4HZjBw==} engines: {node: '>= 14.6'} peerDependencies: '@vue/composition-api': ^1.0.0-rc.1 diff --git a/specs/fixtures/issues/2338/app.vue b/specs/fixtures/issues/2338/app.vue new file mode 100644 index 000000000..2b1be0907 --- /dev/null +++ b/specs/fixtures/issues/2338/app.vue @@ -0,0 +1,5 @@ + diff --git a/specs/fixtures/issues/2338/components/Hello.vue b/specs/fixtures/issues/2338/components/Hello.vue new file mode 100644 index 000000000..a770a0941 --- /dev/null +++ b/specs/fixtures/issues/2338/components/Hello.vue @@ -0,0 +1,9 @@ + + + diff --git a/specs/fixtures/issues/2338/nuxt.config.ts b/specs/fixtures/issues/2338/nuxt.config.ts new file mode 100644 index 000000000..636c72909 --- /dev/null +++ b/specs/fixtures/issues/2338/nuxt.config.ts @@ -0,0 +1,10 @@ +// https://nuxt.com/docs/api/configuration/nuxt-config +export default defineNuxtConfig({ + modules: ['@nuxtjs/i18n'], + i18n: { + locales: [{ code: 'nl', iso: 'nl-NL' }], + debug: false, + defaultLocale: 'nl', + strategy: 'prefix_except_default' + } +}) diff --git a/specs/fixtures/issues/2338/package.json b/specs/fixtures/issues/2338/package.json new file mode 100644 index 000000000..c512a8d46 --- /dev/null +++ b/specs/fixtures/issues/2338/package.json @@ -0,0 +1,14 @@ +{ + "name": "nuxt3-test-issues-2338", + "private": true, + "scripts": { + "build": "nuxt build", + "dev": "nuxt dev", + "generate": "nuxt generate", + "preview": "nuxt preview" + }, + "devDependencies": { + "@nuxtjs/i18n": "latest", + "nuxt": "latest" + } +} diff --git a/specs/fixtures/issues/2338/pages/index.vue b/specs/fixtures/issues/2338/pages/index.vue new file mode 100644 index 000000000..78077327c --- /dev/null +++ b/specs/fixtures/issues/2338/pages/index.vue @@ -0,0 +1,10 @@ + + + diff --git a/specs/issues/2338.spec.ts b/specs/issues/2338.spec.ts new file mode 100644 index 000000000..e17c36a1a --- /dev/null +++ b/specs/issues/2338.spec.ts @@ -0,0 +1,21 @@ +import { test, expect, describe } from 'vitest' +import { fileURLToPath } from 'node:url' +import { setup, url, createPage } from '../utils' +import { getData } from '../helper' + +describe('#2338', async () => { + await setup({ + rootDir: fileURLToPath(new URL(`../fixtures/issues/2338`, import.meta.url)) + }) + + test('should be extened API', async () => { + const home = url('/') + const page = await createPage() + await page.goto(home) + + const globalData = await getData(page, '#global') + expect(globalData.code).toEqual('nl') + const localeData = await getData(page, '#local') + expect(localeData.code).toEqual('nl') + }) +})