This commit is contained in:
+2
-4
@@ -84,10 +84,8 @@ export default async function RootLayout({
|
||||
}>) {
|
||||
noStore();
|
||||
|
||||
const [locale, siteSettings] = await Promise.all([
|
||||
getLocale().catch(() => "de"),
|
||||
getSiteSettings(),
|
||||
]);
|
||||
const siteSettings = await getSiteSettings();
|
||||
const locale = await getLocale().catch(() => siteSettings.defaultLocale);
|
||||
|
||||
return (
|
||||
<html lang={locale} dir={getDirection(locale)} suppressHydrationWarning>
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { usePathname } from "next/navigation";
|
||||
import { useLocale } from "next-intl";
|
||||
import { Toaster as HotToaster, type ToasterProps } from "react-hot-toast";
|
||||
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
|
||||
export function Toaster(props: ToasterProps) {
|
||||
const pathname = usePathname();
|
||||
const locale = resolveLocale(pathname.split("/")[1] || "de");
|
||||
const locale = useLocale();
|
||||
const isArabic = locale === "ar";
|
||||
|
||||
const toastClassName = `${isArabic ? "font-arabic tracking-normal" : "font-latin"} text-[13px] leading-5`;
|
||||
|
||||
+4
-1
@@ -1,14 +1,17 @@
|
||||
import { getRequestConfig } from "next-intl/server";
|
||||
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
|
||||
import { routing } from "./routing";
|
||||
|
||||
export default getRequestConfig(async ({ requestLocale }) => {
|
||||
const siteSettings = await getSiteSettings();
|
||||
const requestedLocale = await requestLocale;
|
||||
const locale =
|
||||
requestedLocale &&
|
||||
routing.locales.includes(requestedLocale as (typeof routing.locales)[number])
|
||||
? requestedLocale
|
||||
: routing.defaultLocale;
|
||||
: siteSettings.defaultLocale;
|
||||
|
||||
return {
|
||||
locale,
|
||||
|
||||
Reference in New Issue
Block a user