Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Don’t add default locale to path
Luke Vella3f0256a3a974
diff --git a/apps/landing/src/i18n/client/link.tsx b/apps/landing/src/i18n/client/link.tsxindex 561d11563..5093c757b 100644--- a/apps/landing/src/i18n/client/link.tsx+++ b/apps/landing/src/i18n/client/link.tsx@@ -1,5 +1,6 @@"use client";+import { defaultLocale } from "@rallly/languages";import Link from "next/link";import { useTranslation } from "react-i18next";@@ -13,9 +14,10 @@ export const LinkBase = ({className?: string;}) => {const { i18n } = useTranslation();- const newHref = href.startsWith("/")- ? `/${i18n.resolvedLanguage}${href}`- : href;+ const locale =+ i18n.resolvedLanguage === defaultLocale ? "" : `/${i18n.resolvedLanguage}`;+ const newHref = href.startsWith("/") ? `${locale}${href}` : href;+return (<Link className={className} href={newHref}>{children}