feat: update copyright year placeholders and enhance footer styling; add new project titles and descriptions in Persian; implement locale handling in various components

This commit is contained in:
2025-06-16 15:21:44 +03:30
parent 5818c895cd
commit 8ddf2dc7db
15 changed files with 43 additions and 13 deletions
@@ -0,0 +1,37 @@
import '@/app/globals.css';
import { notFound } from 'next/navigation';
import { NextIntlClientProvider } from 'next-intl';
import type { IPageParams } from '@/models/layout.d';
// export const metadata: Metadata = {
// title: 'Create Next App',
// description: 'Generated by create next app',
// };
export default async function ErrorLayout({
children,
params,
}: Readonly<{
children: React.ReactNode;
params: IPageParams;
}>) {
const paramsData = await params;
const locale = paramsData.locale;
const fontClass = locale === 'fa' ? 'font-fa' : 'font-en';
let messages;
try {
messages = (await import(`../../../../messages/${locale}.json`)).default;
} catch (error) {
notFound();
}
return (
<html lang={locale} dir={locale === 'fa' ? 'rtl' : 'ltr'}>
<body className={`min-h-svh w-full overflow-x-hidden ${fontClass}`}>
<NextIntlClientProvider locale={locale} messages={messages}>
{children}
</NextIntlClientProvider>
</body>
</html>
);
}
+43
View File
@@ -0,0 +1,43 @@
import routeFactory from '@/assets/constants/routeFactory';
import images from '@/assets/images/images';
import Button from '@/components/uikit/button';
import { IPageParams } from '@/models/layout';
import { getTranslations, setRequestLocale } from 'next-intl/server';
export async function generateMetadata({ params }: { params: IPageParams }) {
const { locale } = await params;
setRequestLocale(locale);
const t = await getTranslations({ locale });
return {
title: t('page_not_found_metadata_title'),
description: t('page_not_found_metadata_description'),
};
}
export default async function NotFound({ params }: { params: IPageParams }) {
const paramsData = await params;
const t = await getTranslations({ locale: paramsData.locale });
const routes = routeFactory(t, paramsData.locale);
return (
<div className="container mx-auto flex h-svh flex-col items-center justify-center gap-6">
<h2 className="text-center text-4xl md:text-[5rem]">
{t('pages_notFound_title')}
</h2>
<p className="text-center text-xl text-gray-300 md:text-2xl">
{t('pages_notFound_description')}
</p>
<div>
<img
alt="404 page"
src={images.notFound.src}
className="aspect-square"
/>
</div>
<Button link={routes.home.route()} endIcon="showMore" className="w-fit">
{t('pages_notFound_button')}
</Button>
</div>
);
}
+1 -1
View File
@@ -27,7 +27,7 @@ export async function generateMetadata({ params }: { params: IPageParams }) {
locale,
url,
},
authors: [{ name: t('meta.author') }],
// authors: [{ name: t('meta.author') }],
};
}