Next.js Discord

Discord Forum

generete the metadata from translations files

Unanswered
Lesser Scaup posted this in #help-forum
Open in Discord
Lesser ScaupOP
im using next-intl to translate my pages, however my
    "About": {
        "aboutPageTitle": "metadata title - About Us",
        "aboutTitle": "my title",
                "abouttxt":"text"
    },

so each page has inside its object the metadata,
how can i generate these meta data based on languages and the route im in, because i tried to use useTranslations and usePathname, but hook are not allowed in generatemetadata.
can someone help with it.

0 Replies