From 246ad3405459733960dbae05268aee7c59c33a0c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 18 Jul 2026 15:07:55 +0000 Subject: [PATCH] docs: sync recent library and platform behavior --- DOCS-SKILL.md | 2 +- devlog/en-US/gt-next_v6_10_0.mdx | 2 +- devlog/en-US/react-core-linter_v0_1_0.mdx | 2 +- docs/en-US/cli/guides/using-auto-jsx.mdx | 13 ++++++++++++- docs/en-US/cli/reference/formats/gt-jsx-files.mdx | 2 +- docs/en-US/cli/reference/formats/mdx-md-files.mdx | 6 ++++++ docs/en-US/cli/reference/formats/ts-js-files.mdx | 6 ++++++ .../platform/dashboard/guides/managing-billing.mdx | 6 +++--- docs/en-US/react/(frameworks)/nextjs/config.mdx | 2 +- .../react/guides/developing-spa-translations.mdx | 4 ++-- 10 files changed, 34 insertions(+), 11 deletions(-) diff --git a/DOCS-SKILL.md b/DOCS-SKILL.md index 26075c8c..6e41bddf 100644 --- a/DOCS-SKILL.md +++ b/DOCS-SKILL.md @@ -457,7 +457,7 @@ Only document capabilities that actually exist, and resolve anything uncertain a A "common workflow" section is a bulleted roundup that points readers to the main tasks or settings from a landing page (as in the Dashboard get-started **Key workflows** and **Configuration** lists). Each bullet starts with the action, then a short description, then a link: ```text -- **Define context and key terms for translation:** use Context Groups to guide terminology and style across Projects. See [Define translation context](/docs/platform/dashboard/guides/translation-context). +- **Define context and key terms for translation:** use Context Groups to guide terminology and style across Projects. See [Define translation context](/docs/platform/dashboard/guides/adding-translation-context). ``` Use common workflow sections on **Get Started pages and other overview/landing pages** to surface the primary tasks, instead of duplicating full how-tos inline. Do not use them mid-guide, where ordered steps belong. diff --git a/devlog/en-US/gt-next_v6_10_0.mdx b/devlog/en-US/gt-next_v6_10_0.mdx index c4a3da63..dc90ed2d 100644 --- a/devlog/en-US/gt-next_v6_10_0.mdx +++ b/devlog/en-US/gt-next_v6_10_0.mdx @@ -54,7 +54,7 @@ Cached components use their parameters as cache keys, any cached component that When `experimentalLocaleResolution` is enabled: - I18n proxy must be enabled for locale resolution to work (see [I18n Proxy](/docs/react/nextjs/app-router-middleware)) -- It overrides any custom `getLocale` functions (locale resolution happens from the reading the URL path) +- It overrides any custom `getLocale` functions (locale resolution reads the URL path) - It disables `getRegion` and `getDomain` functions - It conflicts with the deprecated `experimentalEnableSSG` configuration - only one can be enabled at a time - You can customize the locale parameter name with `experimentalLocaleResolutionParam` (defaults to `'locale'`) diff --git a/devlog/en-US/react-core-linter_v0_1_0.mdx b/devlog/en-US/react-core-linter_v0_1_0.mdx index 7eb028bf..8f335fec 100644 --- a/devlog/en-US/react-core-linter_v0_1_0.mdx +++ b/devlog/en-US/react-core-linter_v0_1_0.mdx @@ -65,7 +65,7 @@ gt('Hello {name}!', { name }) Add to your ESLint config: ```javascript copy title="eslint.config.js" -import { defineConfig } from 'eslint'; +import { defineConfig } from 'eslint/config'; import gtLint from '@generaltranslation/react-core-linter'; export default defineConfig([ diff --git a/docs/en-US/cli/guides/using-auto-jsx.mdx b/docs/en-US/cli/guides/using-auto-jsx.mdx index 2a624fc1..0a86f6ff 100644 --- a/docs/en-US/cli/guides/using-auto-jsx.mdx +++ b/docs/en-US/cli/guides/using-auto-jsx.mdx @@ -84,7 +84,18 @@ export default withGTConfig(nextConfig, { }); ``` -Run Next.js with webpack. Turbopack disables the Babel compiler, warns that automatic injection will be skipped, and leaves JSX unwrapped. See [Next.js compiler options](/docs/react/nextjs/config#compiler-options). +Run both the development server and production build with webpack: + +```json title="package.json" +{ + "scripts": { + "dev": "next dev --webpack", + "build": "next build --webpack" + } +} +``` + +Next.js 16 uses Turbopack by default. Turbopack disables the Babel compiler, warns that automatic injection will be skipped, and leaves JSX unwrapped. See [Next.js compiler options](/docs/react/nextjs/config#compiler-options). ## How it works [#how] diff --git a/docs/en-US/cli/reference/formats/gt-jsx-files.mdx b/docs/en-US/cli/reference/formats/gt-jsx-files.mdx index 8e380d11..e65179ff 100644 --- a/docs/en-US/cli/reference/formats/gt-jsx-files.mdx +++ b/docs/en-US/cli/reference/formats/gt-jsx-files.mdx @@ -56,4 +56,4 @@ The `gt` entry accepts a `parsingFlags` object that controls how the CLI parses - `devHotReload` — enables runtime translation for new content during development. `true` enables string translation; use an object such as `{ "strings": true, "jsx": true }` to control string and JSX handling separately. - `enableAutoJsxInjection` — wraps translatable JSX text in `` components at build time so you do not have to add them by hand. See [Automatic JSX injection](/docs/cli/guides/using-auto-jsx). - `includeSourceCodeContext` — includes the surrounding source code lines as extra context for each translation. Replaces the deprecated top-level `files.gt.includeSourceCodeContext` key. -- `legacyGtReactImportSource` — makes compiler-injected `gt-react` imports resolve to `gt-react/browser`, for projects that need the legacy import path. +- `legacyGtReactImportSource` — makes compiler-injected imports resolve to `gt-react/browser`. Enable it only with legacy `gt-react` versions that export this path; current versions use the root `gt-react` import. diff --git a/docs/en-US/cli/reference/formats/mdx-md-files.mdx b/docs/en-US/cli/reference/formats/mdx-md-files.mdx index c2fd420a..865683b9 100644 --- a/docs/en-US/cli/reference/formats/mdx-md-files.mdx +++ b/docs/en-US/cli/reference/formats/mdx-md-files.mdx @@ -26,6 +26,12 @@ Add an `mdx` or `md` entry under `files` with an `include` array of glob pattern This translates every MDX file under `content/docs/en` and saves the results to `content/docs/ja`. Use the `md` key instead for Markdown files. See the [configuration reference](/docs/cli/reference/config#files) for all file keys. +## Update static data exports [#data-exports] + +When an updated MDX file contains static data exports, General Translation reuses matching strings from earlier translations and translates only new or changed strings. Reuse applies to exported variables whose values contain only literals, arrays, and plain objects. Exports with spreads, identifiers, function calls, template literals, or JSX use the standard translation path. + +Force retranslation and Glossary retranslation skip this incremental reuse. + ## Rename translated files [#transform] The `transform` key remaps output file names. In the example above, `*.[locale].mdx` changes the translated extension to `.ja.mdx`. Use this when your docs framework expects a locale in the file name rather than in the directory path. diff --git a/docs/en-US/cli/reference/formats/ts-js-files.mdx b/docs/en-US/cli/reference/formats/ts-js-files.mdx index 197bc5b3..1b2e4b80 100644 --- a/docs/en-US/cli/reference/formats/ts-js-files.mdx +++ b/docs/en-US/cli/reference/formats/ts-js-files.mdx @@ -24,3 +24,9 @@ Add a `ts` or `js` entry under `files` with an `include` array of glob patterns. ``` This translates every TypeScript file under `scripts/en` and saves the results to `scripts/fr` and `scripts/es`. Use the `js` key instead for JavaScript files. See the [configuration reference](/docs/cli/reference/config#files) for all file keys. + +## Update static data exports [#data-exports] + +When an updated TypeScript or JavaScript file contains static data exports, General Translation reuses matching strings from earlier translations and translates only new or changed strings. Reuse applies to exported variables whose values contain only literals, arrays, and plain objects. Exports with spreads, identifiers, function calls, template literals, or JSX use the standard translation path. + +Force retranslation and Glossary retranslation skip this incremental reuse. diff --git a/docs/en-US/platform/dashboard/guides/managing-billing.mdx b/docs/en-US/platform/dashboard/guides/managing-billing.mdx index 4d5fc332..4ebe3dc6 100644 --- a/docs/en-US/platform/dashboard/guides/managing-billing.mdx +++ b/docs/en-US/platform/dashboard/guides/managing-billing.mdx @@ -19,13 +19,13 @@ This guide covers General Translation's usage-based billing, pricing, credits, a Start for free. Add a payment method to turn on usage-based billing: - **Starter — $0/month.** For individuals and small teams. There is no monthly fee; you pay only for what you use. Includes unlimited users, projects, and languages, plus the [Translation Editor](/docs/platform/dashboard/guides/reviewing-translations), GitHub integration, and the [Locadex](/docs/platform/locadex/quickstart) AI agent. -- **Enterprise — custom.** For larger teams with complex localization needs. Everything in Starter, plus forward-deployed localization engineers, custom workflows for any file format or framework, shared context across every Project, and enterprise-grade security, SLAs, and support. +- **Enterprise — custom.** For larger teams with complex localization needs. Everything in Starter, plus forward-deployed localization engineers, custom workflows for any file format or framework, shared context across every Project, and enterprise-grade security, SLAs, and support. -Each free organization gets 5M free translation credits to start. You will be rate-limited until you add a payment method. +Each free Organization gets 5M free translation credits to start. You will be rate-limited until you add a payment method. ## Usage-based billing [#usage] -You pay per workflow: cost is based on number of input tokens, workflow type (buildtime, runtime, or development), file format, and any context you provide. +You pay per workflow: cost is based on the number of input tokens, workflow type (build time, runtime, or development), file format, and any context you provide. ### Base workflow rates [#base-rates] diff --git a/docs/en-US/react/(frameworks)/nextjs/config.mdx b/docs/en-US/react/(frameworks)/nextjs/config.mdx index ff3cfd4a..0ddbfe64 100644 --- a/docs/en-US/react/(frameworks)/nextjs/config.mdx +++ b/docs/en-US/react/(frameworks)/nextjs/config.mdx @@ -237,7 +237,7 @@ export default withGTConfig(nextConfig, { }); ``` -Automatic JSX injection only runs in webpack builds. Turbopack disables the Babel compiler, and `type: 'swc'` or `type: 'none'` does not support injection. In each case, `gt-next` warns that injection was skipped. +Automatic JSX injection only runs in webpack builds. Run `next dev --webpack` during development and `next build --webpack` for production. Next.js 16 uses Turbopack by default; Turbopack disables the Babel compiler, and `type: 'swc'` or `type: 'none'` does not support injection. In each case, `gt-next` warns that injection was skipped. ### `headersAndCookies` [#headers-and-cookies] diff --git a/docs/en-US/react/guides/developing-spa-translations.mdx b/docs/en-US/react/guides/developing-spa-translations.mdx index 738e1ee3..a79c8c6f 100644 --- a/docs/en-US/react/guides/developing-spa-translations.mdx +++ b/docs/en-US/react/guides/developing-spa-translations.mdx @@ -19,7 +19,7 @@ Development translations let you preview translated content as you edit your SPA - A development API key that starts with `gtx-dev-` - **CommonJS limitation:** CommonJS is not currently supported by the GT compiler. Development hot reloading requires ESM imports and does not work in applications compiled as CommonJS. Production translations still work with the CommonJS startup pattern in the [SPA Quickstart](/docs/react/react-spa-quickstart). + **CommonJS limitation:** Development hot reloading requires ESM because the compiler injects top-level `await`. It does not work in applications compiled as CommonJS. Production translations still work with the CommonJS startup pattern in the [SPA Quickstart](/docs/react/react-spa-quickstart). ## Setup [#setup] @@ -70,7 +70,7 @@ import { defineConfig } from 'vite'; import gtConfig from './gt.config.json'; // [!code highlight] export default defineConfig({ - plugins: [gtCompiler({ ...gtConfig }), react()], // [!code highlight] + plugins: [react(), gtCompiler({ ...gtConfig })], // [!code highlight] }); ```