Skip to content

Commit

Permalink
fix: mergeTranslations
Browse files Browse the repository at this point in the history
  • Loading branch information
s00d committed Aug 19, 2024
1 parent 7bcb128 commit 321d2d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/plugins/01.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/translationHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 321d2d9

Please sign in to comment.