refactor: update translation keys in configuration files

- Modified translation keys in avatar, footer, navbar, sidebar, and social configuration files to enhance modularity and maintainability.
- Removed redundant 'Marketing' prefix from translation keys for improved clarity and consistency across the application.
This commit is contained in:
javayhu 2025-04-10 09:56:43 +08:00
parent 643cbbef9b
commit 2cb95d8a1a
6 changed files with 75 additions and 90 deletions

View File

@ -13,21 +13,21 @@ import { useTranslations } from 'next-intl';
* @returns The avatar config with translated titles
*/
export function getAvatarConfig(): MenuItem[] {
const t = useTranslations();
const t = useTranslations('Marketing.avatar');
return [
{
title: t('Marketing.avatar.dashboard'),
title: t('dashboard'),
href: Routes.Dashboard,
icon: <LayoutDashboardIcon className="size-4 shrink-0" />,
},
{
title: t('Marketing.avatar.billing'),
title: t('billing'),
href: Routes.SettingsBilling,
icon: <CreditCardIcon className="size-4 shrink-0" />,
},
{
title: t('Marketing.avatar.settings'),
title: t('settings'),
href: Routes.SettingsProfile,
icon: <Settings2Icon className="size-4 shrink-0" />,
},

View File

@ -12,84 +12,84 @@ import { useTranslations } from 'next-intl';
* @returns The footer config with translated titles
*/
export function getFooterConfig(): NestedMenuItem[] {
const t = useTranslations();
const t = useTranslations('Marketing.footer');
return [
{
title: t('Marketing.footer.product.title'),
title: t('product.title'),
items: [
{
title: t('Marketing.footer.product.items.features'),
title: t('product.items.features'),
href: Routes.Features,
external: false,
},
{
title: t('Marketing.footer.product.items.pricing'),
title: t('product.items.pricing'),
href: Routes.Pricing,
external: false,
},
{
title: t('Marketing.footer.product.items.faq'),
title: t('product.items.faq'),
href: Routes.FAQ,
external: false,
},
],
},
{
title: t('Marketing.footer.resources.title'),
title: t('resources.title'),
items: [
{
title: t('Marketing.footer.resources.items.blog'),
title: t('resources.items.blog'),
href: Routes.Blog,
external: false,
},
{
title: t('Marketing.footer.resources.items.changelog'),
title: t('resources.items.changelog'),
href: Routes.Changelog,
external: false,
},
{
title: t('Marketing.footer.resources.items.roadmap'),
title: t('resources.items.roadmap'),
href: Routes.Roadmap,
external: true,
},
],
},
{
title: t('Marketing.footer.company.title'),
title: t('company.title'),
items: [
{
title: t('Marketing.footer.company.items.about'),
title: t('company.items.about'),
href: Routes.About,
external: false,
},
{
title: t('Marketing.footer.company.items.contact'),
title: t('company.items.contact'),
href: Routes.Contact,
external: false,
},
{
title: t('Marketing.footer.company.items.waitlist'),
title: t('company.items.waitlist'),
href: Routes.Waitlist,
external: false,
},
],
},
{
title: t('Marketing.footer.legal.title'),
title: t('legal.title'),
items: [
{
title: t('Marketing.footer.legal.items.cookiePolicy'),
title: t('legal.items.cookiePolicy'),
href: Routes.CookiePolicy,
external: false,
},
{
title: t('Marketing.footer.legal.items.privacyPolicy'),
title: t('legal.items.privacyPolicy'),
href: Routes.PrivacyPolicy,
external: false,
},
{
title: t('Marketing.footer.legal.items.termsOfService'),
title: t('legal.items.termsOfService'),
href: Routes.TermsOfService,
external: false,
},

View File

@ -40,56 +40,56 @@ import { useTranslations } from 'next-intl';
* @returns The navbar config with translated titles and descriptions
*/
export function getNavbarConfig(): NestedMenuItem[] {
const t = useTranslations();
const t = useTranslations('Marketing.navbar');
return [
{
title: t('Marketing.navbar.features.title'),
title: t('features.title'),
href: Routes.Features,
external: false,
},
{
title: t('Marketing.navbar.pricing.title'),
title: t('pricing.title'),
href: Routes.Pricing,
external: false,
},
{
title: t('Marketing.navbar.blog.title'),
title: t('blog.title'),
href: Routes.Blog,
external: false,
},
{
title: t('Marketing.navbar.docs.title'),
title: t('docs.title'),
href: Routes.Docs,
external: false,
},
{
title: t('Marketing.navbar.ai.title'),
title: t('ai.title'),
items: [
{
title: t('Marketing.navbar.ai.items.text.title'),
description: t('Marketing.navbar.ai.items.text.description'),
title: t('ai.items.text.title'),
description: t('ai.items.text.description'),
icon: <SquarePenIcon className="site-4 shrink-0" />,
href: Routes.AIText,
external: false,
},
{
title: t('Marketing.navbar.ai.items.image.title'),
description: t('Marketing.navbar.ai.items.image.description'),
title: t('ai.items.image.title'),
description: t('ai.items.image.description'),
icon: <ImageIcon className="site-4 shrink-0" />,
href: Routes.AIImage,
external: false,
},
{
title: t('Marketing.navbar.ai.items.video.title'),
description: t('Marketing.navbar.ai.items.video.description'),
title: t('ai.items.video.title'),
description: t('ai.items.video.description'),
icon: <FilmIcon className="site-4 shrink-0" />,
href: Routes.AIVideo,
external: false,
},
{
title: t('Marketing.navbar.ai.items.audio.title'),
description: t('Marketing.navbar.ai.items.audio.description'),
title: t('ai.items.audio.title'),
description: t('ai.items.audio.description'),
icon: <AudioLinesIcon className="site-4 shrink-0" />,
href: Routes.AIAudio,
external: false,
@ -97,66 +97,60 @@ export function getNavbarConfig(): NestedMenuItem[] {
],
},
{
title: t('Marketing.navbar.pages.title'),
title: t('pages.title'),
items: [
{
title: t('Marketing.navbar.pages.items.about.title'),
description: t('Marketing.navbar.pages.items.about.description'),
title: t('pages.items.about.title'),
description: t('pages.items.about.description'),
icon: <BuildingIcon className="site-4 shrink-0" />,
href: Routes.About,
external: false,
},
{
title: t('Marketing.navbar.pages.items.contact.title'),
description: t('Marketing.navbar.pages.items.contact.description'),
title: t('pages.items.contact.title'),
description: t('pages.items.contact.description'),
icon: <MailIcon className="site-4 shrink-0" />,
href: Routes.Contact,
external: false,
},
{
title: t('Marketing.navbar.pages.items.waitlist.title'),
description: t('Marketing.navbar.pages.items.waitlist.description'),
title: t('pages.items.waitlist.title'),
description: t('pages.items.waitlist.description'),
icon: <MailboxIcon className="site-4 shrink-0" />,
href: Routes.Waitlist,
external: false,
},
{
title: t('Marketing.navbar.pages.items.roadmap.title'),
description: t('Marketing.navbar.pages.items.roadmap.description'),
title: t('pages.items.roadmap.title'),
description: t('pages.items.roadmap.description'),
icon: <SquareKanbanIcon className="site-4 shrink-0" />,
href: Routes.Roadmap,
external: true,
},
{
title: t('Marketing.navbar.pages.items.changelog.title'),
description: t('Marketing.navbar.pages.items.changelog.description'),
title: t('pages.items.changelog.title'),
description: t('pages.items.changelog.description'),
icon: <ListChecksIcon className="site-4 shrink-0" />,
href: Routes.Changelog,
external: false,
},
{
title: t('Marketing.navbar.pages.items.cookiePolicy.title'),
description: t(
'Marketing.navbar.pages.items.cookiePolicy.description'
),
title: t('pages.items.cookiePolicy.title'),
description: t('pages.items.cookiePolicy.description'),
icon: <CookieIcon className="site-4 shrink-0" />,
href: Routes.CookiePolicy,
external: false,
},
{
title: t('Marketing.navbar.pages.items.privacyPolicy.title'),
description: t(
'Marketing.navbar.pages.items.privacyPolicy.description'
),
title: t('pages.items.privacyPolicy.title'),
description: t('pages.items.privacyPolicy.description'),
icon: <ShieldCheckIcon className="site-4 shrink-0" />,
href: Routes.PrivacyPolicy,
external: false,
},
{
title: t('Marketing.navbar.pages.items.termsOfService.title'),
description: t(
'Marketing.navbar.pages.items.termsOfService.description'
),
title: t('pages.items.termsOfService.title'),
description: t('pages.items.termsOfService.description'),
icon: <FileTextIcon className="site-4 shrink-0" />,
href: Routes.TermsOfService,
external: false,
@ -164,94 +158,94 @@ export function getNavbarConfig(): NestedMenuItem[] {
],
},
{
title: t('Marketing.navbar.blocks.title'),
title: t('blocks.title'),
items: [
{
title: t('Marketing.navbar.blocks.items.hero.title'),
title: t('blocks.items.hero.title'),
icon: <FlameIcon className="site-4 shrink-0" />,
href: Routes.HeroBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.logo.title'),
title: t('blocks.items.logo.title'),
icon: <SquareCodeIcon className="site-4 shrink-0" />,
href: Routes.LogoBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.features.title'),
title: t('blocks.items.features.title'),
icon: <WandSparklesIcon className="site-4 shrink-0" />,
href: Routes.FeaturesBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.content.title'),
title: t('blocks.items.content.title'),
icon: <NewspaperIcon className="site-4 shrink-0" />,
href: Routes.ContentBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.stats.title'),
title: t('blocks.items.stats.title'),
icon: <ChartNoAxesCombinedIcon className="site-4 shrink-0" />,
href: Routes.StatsBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.team.title'),
title: t('blocks.items.team.title'),
icon: <UsersIcon className="site-4 shrink-0" />,
href: Routes.TeamBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.testimonials.title'),
title: t('blocks.items.testimonials.title'),
icon: <ThumbsUpIcon className="site-4 shrink-0" />,
href: Routes.TestimonialsBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.callToAction.title'),
title: t('blocks.items.callToAction.title'),
icon: <RocketIcon className="site-4 shrink-0" />,
href: Routes.CallToActionBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.footer.title'),
title: t('blocks.items.footer.title'),
icon: <FootprintsIcon className="site-4 shrink-0" />,
href: Routes.FooterBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.pricing.title'),
title: t('blocks.items.pricing.title'),
icon: <CircleDollarSignIcon className="site-4 shrink-0" />,
href: Routes.PricingBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.comparator.title'),
title: t('blocks.items.comparator.title'),
icon: <SplitSquareVerticalIcon className="site-4 shrink-0" />,
href: Routes.ComparatorBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.faq.title'),
title: t('blocks.items.faq.title'),
icon: <CircleHelpIcon className="site-4 shrink-0" />,
href: Routes.FAQBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.login.title'),
title: t('blocks.items.login.title'),
icon: <LogInIcon className="site-4 shrink-0" />,
href: Routes.LoginBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.signup.title'),
title: t('blocks.items.signup.title'),
icon: <UserPlusIcon className="site-4 shrink-0" />,
href: Routes.SignupBlocks,
external: false,
},
{
title: t('Marketing.navbar.blocks.items.contact.title'),
title: t('blocks.items.contact.title'),
icon: <MailIcon className="site-4 shrink-0" />,
href: Routes.ContactBlocks,
external: false,

View File

@ -20,39 +20,39 @@ import { useTranslations } from 'next-intl';
* @returns The sidebar config with translated titles and descriptions
*/
export function getSidebarConfig(): NestedMenuItem[] {
const t = useTranslations();
const t = useTranslations('Dashboard');
return [
{
title: t('Dashboard.dashboard.title'),
title: t('dashboard.title'),
icon: <LayoutDashboardIcon className="site-4 shrink-0" />,
href: Routes.Dashboard,
external: false,
},
{
title: t('Dashboard.settings.title'),
title: t('settings.title'),
icon: <Settings2Icon className="site-4 shrink-0" />,
items: [
{
title: t('Dashboard.settings.profile.title'),
title: t('settings.profile.title'),
icon: <CircleUserRoundIcon className="site-4 shrink-0" />,
href: Routes.SettingsProfile,
external: false,
},
{
title: t('Dashboard.settings.billing.title'),
title: t('settings.billing.title'),
icon: <CreditCardIcon className="site-4 shrink-0" />,
href: Routes.SettingsBilling,
external: false,
},
{
title: t('Dashboard.settings.security.title'),
title: t('settings.security.title'),
icon: <LockKeyholeIcon className="site-4 shrink-0" />,
href: Routes.SettingsSecurity,
external: false,
},
{
title: t('Dashboard.settings.notification.title'),
title: t('settings.notification.title'),
icon: <BellIcon className="site-4 shrink-0" />,
href: Routes.SettingsNotifications,
external: false,

View File

@ -22,15 +22,6 @@ import { websiteConfig } from './website';
export function getSocialConfig(): MenuItem[] {
const socialLinks: MenuItem[] = [];
// Only add social links that are configured in websiteConfig
if (websiteConfig.mail.from) {
socialLinks.push({
title: 'Email',
href: `mailto:${websiteConfig.mail.from}`,
icon: <MailIcon className="size-4 shrink-0" />,
});
}
if (websiteConfig.social.github) {
socialLinks.push({
title: 'GitHub',

0
src/db/query.ts Normal file
View File