titles
Some checks failed
Build & Deploy KLZ Cables / build-and-deploy (push) Has been cancelled

This commit is contained in:
2026-01-27 00:07:00 +01:00
parent b8fdbfb10b
commit a805c7b8de
6 changed files with 53 additions and 23 deletions

View File

@@ -38,22 +38,22 @@ export default function HomePage({ params: { locale } }: { params: { locale: str
}
export async function generateMetadata({ params: { locale } }: { params: { locale: string } }): Promise<Metadata> {
// Use translations for meta where available (namespace: Home.meta)
// Use translations for meta where available (namespace: Index.meta)
// Fallback to a sensible default if translation keys are missing.
let t;
try {
t = await getTranslations({ locale, namespace: 'Home.meta' });
t = await getTranslations({ locale, namespace: 'Index.meta' });
} catch (err) {
// If translations for Home.meta are not present, try generic Home namespace
// If translations for Index.meta are not present, try generic Index namespace
try {
t = await getTranslations({ locale, namespace: 'Home' });
t = await getTranslations({ locale, namespace: 'Index' });
} catch (e) {
t = (key: string) => '';
}
}
const title = t('title') || 'KLZ Cables';
const description = t('description') || t('subtitle') || '';
const description = t('description') || '';
return {
title,