spliit icon indicating copy to clipboard operation
spliit copied to clipboard

Page titles not working with translations

Open Petersmit27 opened this issue 8 months ago • 1 comments

Seems like the title for each page is hardcoded, and thus don't change if the language is updated.

It would be nice if these can change dynamically as well.

Petersmit27 avatar Apr 15 '25 08:04 Petersmit27

@scastiel ,

We can fetch the translations and define title so that the title will be in the selected language. But we would have to do this for all the pages.

export async function generateMetadata(): Promise<Metadata> {
  const t = await getTranslations('ExpenseForm')

  return {
    title: t('Expense.edit', { fallback: 'Edit expense' }),
  }
}

Is it worth the overhead? Should I do it?

yuvarajsai avatar Apr 20 '25 10:04 yuvarajsai