nuxt-i18n-micro
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,1 +0,1 @@ | ||
{"id":"c53d284f-1ca1-4e93-bf70-990155baabf5","timestamp":1723869304838} | ||
{"id":"29fcfc53-dd00-4f63-aad8-54e96d19e2cd","timestamp":1723887203026} |
{ | ||
"name": "nuxt-i18n-micro", | ||
"configKey": "i18n", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"builder": { | ||
@@ -6,0 +6,0 @@ "@nuxt/module-builder": "0.8.3", |
@@ -73,15 +73,11 @@ import { defineNuxtPlugin, useRuntimeConfig } from "#app"; | ||
const currentLocale = (locale || route.params.locale || defaultLocale).toString(); | ||
let resolvedRoute = router.resolve(to); | ||
if (typeof to === "object" && "name" in to) { | ||
resolvedRoute = router.resolve({ name: to.name, params: to.params, query: to.query, hash: to.hash }); | ||
delete resolvedRoute.params.locale; | ||
if (resolvedRoute.name) { | ||
const routeName = resolvedRoute.name.replace(`localized-`, ""); | ||
resolvedRoute.name = currentLocale !== defaultLocale || i18nConfig.includeDefaultLocaleRoute ? `localized-${routeName}` : routeName; | ||
if (defaultLocale !== currentLocale || i18nConfig.includeDefaultLocaleRoute) { | ||
resolvedRoute.params.locale = currentLocale; | ||
} | ||
} | ||
const selectRoute = router.resolve(to); | ||
const routeName = selectRoute.name.replace(`localized-`, ""); | ||
const newRouteName = currentLocale !== defaultLocale || i18nConfig.includeDefaultLocaleRoute ? `localized-${routeName}` : routeName; | ||
const newParams = { ...route.params }; | ||
delete newParams.locale; | ||
if (currentLocale !== defaultLocale || i18nConfig.includeDefaultLocaleRoute) { | ||
newParams.locale = currentLocale; | ||
} | ||
return resolvedRoute; | ||
return router.resolve({ name: newRouteName, params: newParams }); | ||
} | ||
@@ -88,0 +84,0 @@ export default defineNuxtPlugin(async (_nuxtApp) => { |
{ | ||
"name": "nuxt-i18n-micro", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Nuxt I18n Micro is a lightweight, high-performance internationalization module for Nuxt, designed to handle multi-language support with minimal overhead, fast build times, and efficient runtime performance.", | ||
@@ -50,3 +50,3 @@ "repository": "s00d/nuxt-i18n-micro", | ||
"lint:fix": "eslint . --fix", | ||
"test": "vitest run", | ||
"test": "playwright test", | ||
"test:watch": "vitest watch", | ||
@@ -71,7 +71,8 @@ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit", | ||
"@nuxt/test-utils": "^3.14.1", | ||
"@playwright/test": "^1.46.1", | ||
"@types/node": "^20.14.11", | ||
"changelogen": "^0.5.5", | ||
"eslint": "^9.7.0", | ||
"execa": "^9.3.0", | ||
"nuxt": "^3.12.4", | ||
"execa": "^9.3.0", | ||
"typescript": "latest", | ||
@@ -78,0 +79,0 @@ "vitest": "^2.0.3", |
@@ -1,3 +0,1 @@ | ||
# Nuxt I18n Micro | ||
<div class="links"> | ||
@@ -18,2 +16,8 @@ <a href="https://www.npmjs.com/package/nuxt-i18n-micro" target="_blank"> | ||
<p align="center"> | ||
<img src="https://github.com/s00d/nuxt-i18n-micro/blob/main/logo.png?raw=true" alt="logo"> | ||
</p> | ||
# Nuxt I18n Micro | ||
`Nuxt I18n Micro` is a fast, simple, and lightweight internationalization (i18n) module for Nuxt. Despite its compact size, it's designed with large projects in mind, offering significant performance improvements over traditional i18n solutions like `nuxt-i18n`. The module was built from the ground up to be highly efficient, focusing on minimizing build times, reducing server load, and shrinking bundle sizes. | ||
@@ -20,0 +24,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
203207
1241
247
16