diff --git a/examples/with-app-directory/locales/ca/common.json b/examples/with-app-directory/locales/ca/common.json index c101a12..eb27640 100644 --- a/examples/with-app-directory/locales/ca/common.json +++ b/examples/with-app-directory/locales/ca/common.json @@ -1,6 +1,7 @@ { "title": "Llibreria next-translate", "second-page": "Segona <0>pàgina", + "second-page-title": "Títol Segona Pàgina", "loading": "Carregant...", "layout-title": "Títol de la pàgina (del layout)" } diff --git a/examples/with-app-directory/locales/en/common.json b/examples/with-app-directory/locales/en/common.json index 215e13b..19ede98 100644 --- a/examples/with-app-directory/locales/en/common.json +++ b/examples/with-app-directory/locales/en/common.json @@ -1,6 +1,7 @@ { "title": "next-translate library", "second-page": "Second <0>page", + "second-page-title": "Second Page Title", "loading": "Loading...", "layout-title": "Layout title" } diff --git a/examples/with-app-directory/locales/es/common.json b/examples/with-app-directory/locales/es/common.json index 5be4f70..3b31501 100644 --- a/examples/with-app-directory/locales/es/common.json +++ b/examples/with-app-directory/locales/es/common.json @@ -1,6 +1,7 @@ { "title": "Librería next-translate", "second-page": "Segunda <0>página", + "second-page-title": "Título Segunda Página", "loading": "Cargando...", "layout-title": "Título de la página (del layout)" } diff --git a/examples/with-app-directory/src/app/[lang]/second-page/page.tsx b/examples/with-app-directory/src/app/[lang]/second-page/page.tsx index 1583207..611d324 100644 --- a/examples/with-app-directory/src/app/[lang]/second-page/page.tsx +++ b/examples/with-app-directory/src/app/[lang]/second-page/page.tsx @@ -1,6 +1,15 @@ import Link from 'next/link' import useTranslation from 'next-translate/useTranslation' import Trans from 'next-translate/Trans' +import { Metadata } from "next"; + +export function generateMetadata(): Metadata { + const { t } = useTranslation("common"); + + return { + title: t`second-page-title` + }; +} export default function Page() { const { t, lang } = useTranslation('common')