From 761241392f4653753cfd26968bae3b2f1334d9e4 Mon Sep 17 00:00:00 2001 From: KishiTheMechanic Date: Sat, 26 Oct 2024 23:56:46 +0200 Subject: [PATCH] fix --- deno.json | 2 +- src/i18nPlugin.ts | 6 +++++- src/useTranslation.ts | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deno.json b/deno.json index 6ca44ba..efebf54 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@elsoul/fresh-i18n", - "version": "0.8.0", + "version": "0.9.0", "description": "A simple and flexible internationalization (i18n) plugin for Deno's Fresh framework.", "runtimes": ["deno", "browser"], "exports": "./mod.ts", diff --git a/src/i18nPlugin.ts b/src/i18nPlugin.ts index 886157a..2278735 100644 --- a/src/i18nPlugin.ts +++ b/src/i18nPlugin.ts @@ -1,3 +1,5 @@ +// i18nPlugin.ts + import { join } from '@std/path' import { pathname, translationData } from '@/src/store.ts' import type { MiddlewareFn } from '@/src/types.ts' @@ -79,8 +81,10 @@ export const i18nPlugin = ( } } - // Load the common namespace and additional namespaces based on the URL path. + // Load the common and metadata namespace and additional namespaces based on the URL path. await loadTranslation('common') + await loadTranslation('metadata') + for ( const segment of pathSegments.slice(lang === pathSegments[0] ? 1 : 0) ) { diff --git a/src/useTranslation.ts b/src/useTranslation.ts index dd4c7f4..8038083 100644 --- a/src/useTranslation.ts +++ b/src/useTranslation.ts @@ -1,5 +1,3 @@ -// useTranslation.ts - import { translationData } from '@/src/store.ts' /**