From 321d2d9ad200481b30167009ccd2dd1747a2f7ad Mon Sep 17 00:00:00 2001 From: Pavel Kuzmin Date: Mon, 19 Aug 2024 23:30:57 +0500 Subject: [PATCH] fix: mergeTranslations --- src/runtime/plugins/01.plugin.ts | 2 +- src/runtime/translationHelper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/plugins/01.plugin.ts b/src/runtime/plugins/01.plugin.ts index c93ad3d1..55a921a6 100644 --- a/src/runtime/plugins/01.plugin.ts +++ b/src/runtime/plugins/01.plugin.ts @@ -212,7 +212,7 @@ export default defineNuxtPlugin(async (nuxtApp) => { const route = useRoute() const routeName = (route.name as string).replace(`localized-`, '') const locale = (route.params?.locale ?? i18nConfig.defaultLocale).toString() - i18nHelper.margeTranslation(routeName, locale, newTranslations) + i18nHelper.margeTranslation(locale, routeName, newTranslations) }, switchLocale: (locale: string) => { const route = useRoute() diff --git a/src/runtime/translationHelper.ts b/src/runtime/translationHelper.ts index b9fbaaab..95676aa1 100644 --- a/src/runtime/translationHelper.ts +++ b/src/runtime/translationHelper.ts @@ -53,7 +53,7 @@ export function useTranslationHelper() { }, margeTranslation(locale: string, routeName: string, newTranslations: Translations) { if (!routeLocaleCache[`${locale}:${routeName}`]) { - console.error(`marge: route ${routeName} not loaded`) + console.error(`marge: route ${locale}:${routeName} not loaded`) } routeLocaleCache[`${locale}:${routeName}`] = { ...generalLocaleCache[locale],