This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user