Skip to content

docs(next): add metadata translation example and link pluralization from quickstarts#172

Open
moss-bryophyta wants to merge 1 commit intomainfrom
dx-feedback/metadata-translation-guide
Open

docs(next): add metadata translation example and link pluralization from quickstarts#172
moss-bryophyta wants to merge 1 commit intomainfrom
dx-feedback/metadata-translation-guide

Conversation

@moss-bryophyta
Copy link
Copy Markdown
Collaborator

DX Feedback Loop — Run 3 (2026-03-22)

What triggered this

A naive sub-agent building a Next.js app with metadata translation (page titles, descriptions, OG tags) could not find any documentation on how to use getGT() inside generateMetadata(). The agent had to read .d.ts files to figure out the pattern.

Wrong approach the agent might have tried

  • Using <T> inside metadata (impossible — metadata is a plain object, not JSX)
  • Using useGT() hook inside generateMetadata() (wrong — it's an async server function, not a React component)

What this PR does

  1. Adds a metadata translation example to the getGT API reference page showing the generateMetadata() pattern with titles, descriptions, and OG tags
  2. Adds pluralization and metadata links to the Next.js quickstart "Next steps" section so developers can discover <Plural> and the metadata pattern
  3. Adds pluralization link to the React quickstart "Next steps" section

Correct pattern

import { getGT } from 'gt-next/server';

export async function generateMetadata(): Promise<Metadata> {
  const gt = await getGT();
  return {
    title: gt('My App'),
    description: gt('A fast, modern web application'),
    openGraph: {
      title: gt('My App'),
      description: gt('A fast, modern web application'),
    },
  };
}

@moss-bryophyta moss-bryophyta requested a review from a team as a code owner March 22, 2026 20:03
@moss-bryophyta moss-bryophyta enabled auto-merge (squash) March 22, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant