From 57baf85e349f8e643be824f118dd6180bf62bb7e Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 3 Jun 2026 21:35:51 +0000 Subject: [PATCH 1/2] Update src/config.ts --- src/config.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/config.ts b/src/config.ts index 1fe1c5e..168d5bf 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,16 +1,5 @@ -import { Pathnames } from 'next-intl/navigation'; +export const locales = ['en', 'de'] as const; +export const localePrefix = 'always'; // Default -export const locales = ['en', 'ar'] as const; -export const defaultLocale = 'ar'; // Set default to Arabic as current content is Arabic - -// Use 'always' to ensure the locale is always in the URL (e.g., /en, /ar) -export const localePrefix = 'always'; - -// Define pathnames for internationalized routes if applicable -// For a single-page app with sections, pathnames might not be strictly necessary for section IDs, -// but useful if you plan to have separate pages later (e.g., /en/about vs /ar/about) -export const pathnames = { - '/': '/', -} satisfies Pathnames; - -export type AppPathnames = keyof typeof pathnames; +export const { Link, redirect, usePathname, useRouter } = + createSharedPathnamesNavigation({ locales, localePrefix }); \ No newline at end of file From a18357792f1b3fad58ac71c2d166b5e84ea957ea Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 3 Jun 2026 21:35:52 +0000 Subject: [PATCH 2/2] Update src/i18n.ts --- src/i18n.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/i18n.ts b/src/i18n.ts index 1974542..668b132 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,6 +1,7 @@ -import { getRequestConfig } from 'next-intl/server'; import { notFound } from 'next/navigation'; -import { locales } from './config'; + +// Can be imported from a shared config +const locales = ['en', 'de']; export default getRequestConfig(async ({ locale }) => { if (!locales.includes(locale as any)) notFound(); @@ -8,4 +9,4 @@ export default getRequestConfig(async ({ locale }) => { return { messages: (await import(`../messages/${locale}.json`)).default, }; -}); +}); \ No newline at end of file