Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions DOCS-SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ The **overview** section doubles as a **landing hub**: its `meta.json` lists the

### Machine-readable outputs

The docs are written to be consumed by LLMs and agents, not only humans. Alongside the filetree, publish two machine-readable maps at the repo root, both **generated from the** `meta.json` **filetree** (never hand-edited):
The publishing app generates two machine-readable maps from the docs source:

- `llms.txt` — an [llmstxt.org](https://llmstxt.org/)-style index for LLMs and agents: an H1, a one-line blockquote summary, then per-section lists of `- [Title](url): description` links.
- `sitemap.md` — a linked, hierarchical map of every published page in navigation order.
- `llms.txt` — an [llmstxt.org](https://llmstxt.org/)-style index for LLMs and agents, grouped by section.
- `sitemap.xml` — the standard sitemap for every published page, including localized docs URLs.

Regenerate both whenever you add, rename, remove, or reorder pages, so they stay in sync with the `meta.json` filetree. **Only include pages that actually exist** — omit in-progress sections and manifest-only stubs, and keep every link resolvable.
Do not add hand-written copies to this repository. When you add, rename, remove, or reorder pages, keep the `meta.json` filetree valid so the publishing app generates current output. **Only include pages that actually exist** — omit in-progress sections and manifest-only stubs, and keep every link resolvable.

### Agent-navigable by default

Expand All @@ -276,7 +276,7 @@ Structure it in this order:
3. **Core usage** — the canonical patterns the agent should follow (for example, wrap user-facing strings in `<T>`, use `useGT()` for dynamic strings, keep locale configuration in one place). Show minimal, commented code.
4. **Commands** — a short cheat-sheet of the CLI commands the agent will run (`npx gt configure`, `npx gt translate`, and so on) and when to run each.
5. **Rules — do and don't** — explicit guardrails: what to always do (wrap new copy, run `gt translate` before committing) and what never to do (hardcode translated strings, hand-edit generated translation files).
6. **Links** — point to `llms.txt`, the sitemap, and the most useful pages for deeper detail.
6. **Links** — point to `llms.txt`, `sitemap.xml`, and the most useful pages for deeper detail.

Document only capabilities that exist, and resolve anything uncertain against the codebase (see Source of truth and best judgement). This file is written by an agent connected to the product codebase; this guide defines its **shape**, not its exact contents.

Expand Down Expand Up @@ -445,7 +445,7 @@ Cover, in this order (drop any part that does not yet exist rather than inventin

1. **Intro** — one or two sentences on why General Translation is built to be agent- and LLM-friendly (open-source libraries, predictable configuration, machine-readable docs).
2. **Drop-in agent guide** — the full agent guide (what to use, setup, core usage, commands, do/don't, links) embedded in a **single copyable code block** so a developer can paste it straight into their project's `AGENTS.md`, `CLAUDE.md`, or tool instructions. Use a fenced block with a `title="AGENTS.md"` and a wider outer fence (four backticks) so the guide's own inner code fences render as literal text.
3. **Point agents at the docs** — link the machine-readable entry points (`llms.txt` and the sitemap) and show how to add the docs as context in an agent.
3. **Point agents at the docs** — link the machine-readable entry points (`llms.txt` and `sitemap.xml`) and show how to add the docs as context in an agent.
4. **MCP server and agent skills** — if a General Translation MCP server or agent skill exists, show how to install and use it; otherwise omit this part.
5. **Editor-specific tips** — short, parallel bullets for the common agents (Cursor, Claude Code, Copilot), only where the guidance genuinely differs. Use tabs when the shape is identical (see Code blocks).
6. **Best practices** — a short decision list of what to hand an agent versus what to verify by hand (for example, let it wire up `<T>` components, but always review generated translation context and locale configuration).
Expand Down Expand Up @@ -715,5 +715,5 @@ These patterns are **blocked by CI** and will fail the build, so never use them
- Reference descriptions end with a second sentence: `API reference for X.` for API/library pages, or `Reference for X.` for non-API reference pages (ending with a period).
- No broken internal links (verify the target file exists).
- `related.links` follow the page-type rule: quickstart/entry pages point to four of that section's guides (or all if the section has fewer than four); guide pages link **all** the section's other guides, trimming to the four most relevant only when there are more than four others; neither links reference pages or quickstarts (the guide-less OpenAPI section is the only exception).
- **Machine-readable outputs are in sync:** every entry in each `meta.json` `pages` array resolves to a real file, and `llms.txt` and `sitemap.md` have been regenerated so they list only existing pages.
- **Machine-readable outputs are in sync:** every entry in each `meta.json` `pages` array resolves to a real file, so the publishing app can generate current `llms.txt` and `sitemap.xml` output.
- No typos; body prose sentences end with periods, and so do descriptions (a description that is a question ends with `?`; section-root tab subtitles take no period).
2 changes: 1 addition & 1 deletion blog/en-US/ai-chatbot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default withGTConfig(nextConfig, {

I could've added more locales, but I just wanted to test the chatbot with a few different languages. Feel free to add as many locales as you want!

[Here's a list of all of the ones supported by gt-next](https://generaltranslation.com/docs/platform/supported-locales).
[Here's the list of locales supported by `gt-next`](/docs/platform/dashboard/reference/supported-locales).

### How it works

Expand Down
10 changes: 5 additions & 5 deletions blog/en-US/best-localization-software.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ The library knows nothing about your translations. The TMS knows nothing about y

General Translation is not a library. It's not a TMS. It's the whole pipeline, used by developer-first teams at [Cursor](https://cursor.com), [Cognition](https://cognition.ai), [Windsurf](https://windsurf.com), [Mintlify](https://mintlify.com), and [ClickHouse](https://clickhouse.com).

- **Open-source developer libraries**: [`gt-next`](https://generaltranslation.com/docs/react/nextjs), [`gt-react`](https://generaltranslation.com/docs/react), and support for [React Native/Expo](https://generaltranslation.com/docs/react/react-native). Drop-in SDKs with full TypeScript support.
- **Open-source developer libraries**: [`gt-next`](/docs/react/nextjs-quickstart), [`gt-react`](/docs/react/react-quickstart), and support for [React Native/Expo](/docs/react/react-native-quickstart). Drop-in SDKs with full TypeScript support.
- **An AI-first translation platform** that understands your codebase, your product, and your terminology. Not generic machine translation bolted on top.
- **Locadex, the AI agent**: an [automated internationalization engineer](https://generaltranslation.com/docs/locadex) that scans your codebase, internationalizes your code, creates translations, and opens pull requests on every push.
- **Locadex, the AI agent**: an [automated internationalization engineer](/docs/platform/locadex/quickstart) that scans your codebase, internationalizes your code, creates translations, and opens pull requests on every push.

Building both the library and the translation engine together makes localization ten times easier. No JSON export/import, no file management, no agencies to coordinate. Translations flow directly from your source code to production.

Expand Down Expand Up @@ -58,7 +58,7 @@ At 10 languages and 500 keys, that's 5,000 entries to maintain. At 50 languages

## How General Translation closes the loop

**1. Install and write code.** Run the [setup wizard](https://generaltranslation.com/docs/next/quickstart) and wrap content in `<T>` components. No key extraction. No JSON files.
**1. Install and write code.** Run the [setup wizard](/docs/react/nextjs-quickstart) and wrap content in `<T>` components. No key extraction. No JSON files.

```tsx
import { T } from 'gt-next';
Expand All @@ -75,9 +75,9 @@ export default function Home() {

**2. Develop.** Translations appear on-demand. Switch languages and see results immediately.

**3. Ship.** One command generates all translations at build time. They're pre-generated, cached, and delivered via CDN. Sub-50ms globally. [See the deploy guide →](https://generaltranslation.com/docs/next/quickstart#deploy)
**3. Ship.** One command generates all translations at build time. They're pre-generated, cached, and delivered via CDN. Sub-50ms globally. [See the deploy guide →](/docs/react/nextjs-quickstart#11-deploy-to-production)

**4. Automate.** [Locadex](https://generaltranslation.com/docs/locadex) monitors your repo. When you push code, it scans for changes, internationalizes new content, generates translations, and opens a PR. No human in the loop unless you want one. If you do, the translation editor gives you side-by-side diffs with the ability to edit before or after content goes live.
**4. Automate.** [Locadex](/docs/platform/locadex/quickstart) monitors your repo. When you push code, it scans for changes, internationalizes new content, generates translations, and opens a PR. No human in the loop unless you want one. If you do, the translation editor gives you side-by-side diffs with the ability to edit before or after content goes live.

## Why most translation AI gets it wrong

Expand Down
6 changes: 3 additions & 3 deletions blog/en-US/i18n-without-translation-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function CheckoutSummary({ itemCount, discount }) {
}
```

The `<T>` component in [`gt-react`](https://generaltranslation.com/docs/react) marks a block of JSX for translation. The English stays in your component. When a user visits in Spanish, the content inside `<T>` is replaced with its Spanish equivalent. Structure and formatting carry over.
The `<T>` component in [`gt-react`](/docs/react/react-quickstart) marks a block of JSX for translation. The English stays in your component. When a user visits in Spanish, the content inside `<T>` is replaced with its Spanish equivalent. Structure and formatting carry over.

There's no `t('checkout.summary.title')`, no `en.json`, no per-locale JSON files to keep in sync.

Expand Down Expand Up @@ -118,6 +118,6 @@ But most developers are already thinking in one language when they build UI. The
npx gt@latest init
```

The setup wizard configures your project, installs dependencies, and sets up translation hot reloading for development. Full walkthrough in the [quickstart guide](https://generaltranslation.com/docs/react).
The setup wizard configures your project, installs dependencies, and sets up translation hot reloading for development. See the full walkthrough in the [React Quickstart](/docs/react/react-quickstart).

`gt-react` is open source. For Next.js App Router, there's [`gt-next`](https://generaltranslation.com/docs/react/nextjs). For React Native, there's [`gt-react-native`](https://generaltranslation.com/docs/react/react-native).
`gt-react` is open source. For Next.js App Router, use [`gt-next`](/docs/react/nextjs-quickstart). For React Native, use [`gt-react-native`](/docs/react/react-native-quickstart).
9 changes: 2 additions & 7 deletions blog/en-US/multilingual-nextjs-seo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A multilingual site without proper SEO setup has problems:
- Incorrect language shown in search result snippets

**The good news:** getting multilingual SEO right in Next.js isn't complicated.
There are six things you need to get right, and this guide covers all of them using [gt-next](https://generaltranslation.com/docs/react/nextjs).
There are six things you need to get right, and this guide covers all of them using [`gt-next`](/docs/react/nextjs-quickstart).

---

Expand Down Expand Up @@ -309,9 +309,4 @@ Here's a quick summary of everything covered:

---

## Next steps

- [gt-next quickstart](https://generaltranslation.com/docs/react/nextjs) to set up the full i18n stack
- [Middleware guide](/docs/react/nextjs/app-router-middleware) for routing configuration
- [SSG guide](/docs/react/nextjs) for statically generating multilingual pages
- [RTL support](/docs/react/guides/managing-locales) for right-to-left languages
Use the [`gt-next` Quickstart](/docs/react/nextjs-quickstart) to set up the full internationalization stack. Then configure routing with the [middleware guide](/docs/react/nextjs/app-router-middleware), generate multilingual pages with [static site generation](/docs/react/nextjs/app-router-static-site-generation), and add [right-to-left support](/docs/react/guides/managing-locales).
13 changes: 4 additions & 9 deletions blog/en-US/nextjs-i18n-code-is-the-source-of-truth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ No keys. No JSON files. No cross-referencing. The source of truth is your code.

## Setup

The syntax above comes from [gt-next](https://generaltranslation.com/docs/react/nextjs), an open-source i18n library for Next.js App Router. Getting started takes one command:
The syntax above comes from [`gt-next`](/docs/react/nextjs-quickstart), an open-source i18n library for Next.js App Router. Getting started takes one command:

```bash copy
npx gt@latest init
```

The [setup wizard](https://generaltranslation.com/docs/cli/init) installs dependencies, wraps your Next.js config with [`withGTConfig`](https://generaltranslation.com/docs/next/api/config/with-gt-config), adds [`GTProvider`](https://generaltranslation.com/docs/react/reference/components/gt-provider) to your root layout, creates a [`gt.config.json`](https://generaltranslation.com/docs/cli/reference/config) with your locales, sets up dev API keys for translation hot reloading, and configures CDN translation storage — all interactively.
The [setup wizard](/docs/cli/reference/commands/init) installs dependencies, wraps your Next.js config with [`withGTConfig`](/docs/react/nextjs/config), adds [`GTProvider`](/docs/react/reference/components/gt-provider) to your root layout, creates a [`gt.config.json`](/docs/cli/reference/config) with your locales, sets up dev API keys for translation hot reloading, and configures CDN translation storage — all interactively.

Once that's done, wrap content in `<T>`, run your dev server, and use the [`<LocaleSelector>`](https://generaltranslation.com/docs/react/reference/components/locale-selector) component to switch between languages:

Expand Down Expand Up @@ -79,11 +79,6 @@ In production, translations are pre-generated.
}
```

The [`translate`](https://generaltranslation.com/docs/cli/reference/commands/translate) command scans your codebase for all `<T>` usage, generates translations, and publishes them to a CDN. When your app builds, every locale is ready.
The [`translate`](/docs/cli/reference/commands/translate) command scans your codebase for all `<T>` usage, generates translations, and publishes them to a CDN. When your app builds, every locale is ready.

## Next steps

- [Variable components](https://generaltranslation.com/docs/react/guides/format-variables) — handle dynamic content inside `<T>` with [`<Var>`](https://generaltranslation.com/docs/react/reference/components/var), [`<Num>`](https://generaltranslation.com/docs/react/reference/components/num), and [`<Currency>`](https://generaltranslation.com/docs/react/reference/components/currency)
- [Branching components](https://generaltranslation.com/docs/react/guides/plurals-and-branches) — conditionally render content based on locale with [`<Plural>`](https://generaltranslation.com/docs/react/reference/components/plural) and [`<Branch>`](https://generaltranslation.com/docs/react/reference/components/branch)
- [`useGT`](https://generaltranslation.com/docs/react/reference/hooks/use-gt) and [`getGT`](https://generaltranslation.com/docs/react/reference/functions/get-gt) — translate plain strings for attributes, placeholders, and metadata
- [Standalone mode](https://generaltranslation.com/docs/react/guides/local-translations) — use gt-next without the General Translation platform
Use [variable components](/docs/react/guides/formatting-variables) for dynamic content inside `<T>`, and use [branching components](/docs/react/guides/handling-plurals-and-branches) for locale-aware choices. [`useGT`](/docs/react/reference/hooks/use-gt) and [`getGT`](/docs/react/nextjs/reference/functions/get-gt) translate plain strings for attributes, placeholders, and metadata. To bundle translations with your app instead of loading them from the General Translation CDN, see [Storing translations](/docs/react/guides/storing-translations).
12 changes: 3 additions & 9 deletions blog/en-US/plurals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Although developers often think that i18n libraries are only for multilingual in
they can be very useful for plural and variable formatting even in single-language applications.
Under the hood, most i18n libraries use JavaScript's built-in `Intl.PluralRules` API to determine the correct plural form for any language.

There are plenty of React i18n libraries, including ours, [gt-react](/docs/react/overview) (or [gt-next](/docs/react/nextjs) if you're using Next.js).
There are plenty of React i18n libraries, including ours, [`gt-react`](/docs/react/overview) (or [`gt-next`](/docs/react/nextjs-quickstart) if you're using Next.js).
Displaying an English plural using gt-react is simple:

```jsx
Expand Down Expand Up @@ -200,7 +200,7 @@ Almost all libraries have dedicated documentation on rendering plurals.

### Full example: plurals in a multilingual React app

If you don't already have an internationalization library, consider [gt-react](https://generaltranslation.com/docs/react)!
If you don't already have an internationalization library, consider [`gt-react`](/docs/react/react-quickstart)!

gt-react's `<Plural>` component:

Expand Down Expand Up @@ -235,12 +235,6 @@ function Example({ count }) {

---

## Next steps

Ready to handle plurals properly in your React app? Check out our quickstart guides:

- [gt-react quickstart](https://generaltranslation.com/docs/react) for React apps
- [gt-next quickstart](https://generaltranslation.com/docs/react/nextjs) for Next.js apps
- [`<Plural>` API reference](/docs/react/reference/components/plural) for the full component API
Set up pluralization with the [`gt-react` Quickstart](/docs/react/react-quickstart) for React apps or the [`gt-next` Quickstart](/docs/react/nextjs-quickstart) for Next.js apps. See the [`<Plural>` API reference](/docs/react/reference/components/plural) for the full component API.

Pluralization is one of the most common i18n challenges in React — getting it right from the start saves significant refactoring later.
2 changes: 1 addition & 1 deletion devlog/en-US/gt-next_v6_10_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default withGTConfig(nextConfig, {
})
```

Remove any custom `getStaticLocale`, `getStaticRegion`, or `getStaticDomain` functions in favor of custom `getLocale`, `getRegion`, or `getDomain` functions. You must add a custom `getLocale` function and disable the `getRegion` function. For more information, see the [SSG guide](/docs/react/nextjs).
Remove any custom `getStaticLocale`, `getStaticRegion`, or `getStaticDomain` functions in favor of custom `getLocale`, `getRegion`, or `getDomain` functions. You must add a custom `getLocale` function and disable the `getRegion` function. For more information, see the [SSG guide](/docs/react/nextjs/app-router-static-site-generation).

```ts title="getLocale.ts"
import { locale } from "next/root-params";
Expand Down
2 changes: 1 addition & 1 deletion devlog/en-US/gt-react_v10_19_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default defineConfig({
});
```

See the [gt-react setup docs](https://generaltranslation.com/docs/react/tutorials/quickstart) for other bundlers.
See the [`gt-react` SPA Quickstart](/docs/react/react-spa-quickstart) for other bundlers.

### 2. Enable dev hot reload in `gt.config.json`

Expand Down
5 changes: 1 addition & 4 deletions devlog/en-US/react-core-linter_v0_1_0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,4 @@ Future versions will expand rule coverage and add auto-fixing for other common v

---

## Further reading

- [Variable Components](/docs/react/guides/formatting-variables) - Handle dynamic content in translations
- [String Translation](/docs/react/guides/translating-strings) - Translate plain text strings
Use [variable components](/docs/react/guides/formatting-variables) for dynamic content and [string translation](/docs/react/guides/translating-strings) for plain text strings.
Loading
Loading