refactor: update localization handling in metadata generation
- Replaced `pageTranslations` with `pt` for improved clarity in localization across multiple pages including About, Changelog, Contact, Waitlist, Blog, Pricing, and Auth pages. - Enhanced maintainability by standardizing the variable naming for translation functions.
This commit is contained in:
parent
635346bff6
commit
6569e5c3df
@ -16,11 +16,11 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'AboutPage'});
|
||||
const pt = await getTranslations({locale, namespace: 'AboutPage'});
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
description: pageTranslations('description'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: pt('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/about`,
|
||||
});
|
||||
}
|
||||
|
@ -17,11 +17,11 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'ChangelogPage'});
|
||||
const pt = await getTranslations({locale, namespace: 'ChangelogPage'});
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
description: pageTranslations('description'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: pt('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/changelog`,
|
||||
});
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const { locale } = await params;
|
||||
const t = await getTranslations({ locale, namespace: 'Metadata' });
|
||||
const pageTranslations = await getTranslations({ locale, namespace: 'ContactPage' });
|
||||
const pt = await getTranslations({ locale, namespace: 'ContactPage' });
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
description: pageTranslations('description'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: pt('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/contact`,
|
||||
});
|
||||
}
|
||||
|
@ -12,10 +12,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'WaitlistPage'});
|
||||
const pt = await getTranslations({locale, namespace: 'WaitlistPage'});
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
description: pageTranslations('description'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: pt('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/waitlist`,
|
||||
});
|
||||
}
|
||||
|
@ -17,10 +17,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'BlogPage'});
|
||||
const pt = await getTranslations({locale, namespace: 'BlogPage'});
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
description: pageTranslations('description'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: pt('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/blog`,
|
||||
});
|
||||
}
|
||||
|
@ -15,10 +15,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'PricingPage'});
|
||||
const pt = await getTranslations({locale, namespace: 'PricingPage'});
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
description: pageTranslations('description'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: pt('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/pricing`,
|
||||
});
|
||||
}
|
||||
|
@ -12,10 +12,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'AuthPage.error'});
|
||||
const pt = await getTranslations({locale, namespace: 'AuthPage.error'});
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: t('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/auth/error`,
|
||||
});
|
||||
|
@ -12,10 +12,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'AuthPage.forgotPassword'});
|
||||
const pt = await getTranslations({locale, namespace: 'AuthPage.forgotPassword'});
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: t('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/auth/forgot-password`,
|
||||
});
|
||||
|
@ -14,10 +14,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'AuthPage.login'});
|
||||
const pt = await getTranslations({locale, namespace: 'AuthPage.login'});
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: t('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/auth/login`,
|
||||
});
|
||||
|
@ -12,10 +12,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'AuthPage.register'});
|
||||
const pt = await getTranslations({locale, namespace: 'AuthPage.register'});
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: t('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/auth/register`,
|
||||
});
|
||||
|
@ -12,10 +12,10 @@ export async function generateMetadata({
|
||||
}): Promise<Metadata | undefined> {
|
||||
const {locale} = await params;
|
||||
const t = await getTranslations({locale, namespace: 'Metadata'});
|
||||
const pageTranslations = await getTranslations({locale, namespace: 'AuthPage.resetPassword'});
|
||||
const pt = await getTranslations({locale, namespace: 'AuthPage.resetPassword'});
|
||||
|
||||
return constructMetadata({
|
||||
title: pageTranslations('title') + ' | ' + t('title'),
|
||||
title: pt('title') + ' | ' + t('title'),
|
||||
description: t('description'),
|
||||
canonicalUrl: `${getBaseUrlWithLocale(locale)}/auth/reset-password`,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user