Skip to content

docs: update documentation for the odysseus major release#340

Open
ErnestM1234 wants to merge 3 commits into
mainfrom
docs/odysseus
Open

docs: update documentation for the odysseus major release#340
ErnestM1234 wants to merge 3 commits into
mainfrom
docs/odysseus

Conversation

@ErnestM1234

Copy link
Copy Markdown
Contributor

Summary

Updates all documentation to match the odysseus major release (gt-next/gt-react/gt-react-native/gt-tanstack-start v11, generaltranslation v9, gt-i18n/gt-node v1). Every documented claim was verified against the odysseus branch source in the gt monorepo — including several places where the internal breaking-changes notes turned out to be inaccurate.

gt-next

  • gt-next/client removed; gt-next/server now documents only server-only exports (getLocale, getRegion, getLocaleDirection, registerLocale, tx, Tx, getTranslations, getMessages, getGT); everything else moved to the gt-next index
  • GTProvider props reduced to children (removed id dictionary subsetting, locale, region)
  • withGTConfig: credentials are env-var only (GT_API_KEY, GT_PROJECT_ID, NEXT_PUBLIC_GT_PROJECT_ID for client exposure); removed customMapping prop and all experimental SSG/locale-resolution props; renderSettings is timeout-only; documented headersAndCookies (incl. new enableI18nCookieName)
  • New <Link> component page (gt-next/link)
  • Cache Components guide: custom loadTranslations + getLocale/getRegion now required; caching delegated to Next.js
  • Removed the stale dev-mode "refresh to see server-string translations" guidance (server strings now hot reload)

gt-react

  • Setup moved to initializeGT() (server-rendered) / initializeGTSPA() (SPA); config is read-once/immutable; custom cookie names configured there
  • GTProvider now requires locale + translations snapshot (via getTranslationsSnapshot(locale)); no loading states; SPAs don't need a provider
  • Vite env credentials (VITE_GT_PROJECT_ID, VITE_GT_DEV_API_KEY) documented

gt-react-native

  • Babel plugin is now a named export ({ plugin }) — quickstarts fixed
  • initializeGT() in the app entry; GTProvider keeps async loading with the fallback prop (unique among the packages)
  • Fixed pre-existing errors: LocaleSelector is not exported by gt-react-native; Expo Go doesn't work with the native module

gt-tanstack-start

  • No-arg getTranslations() replaced by getTranslationsSnapshot(locale) + parseLocale() in the route loader; quickstart rewritten

Cross-cutting

  • Type renames: InlineTranslationOptionsGTTranslationOptions, DictionaryTranslationOptionsTranslationVariables (+ DictionaryEntryOptions for entry metadata). Page slugs kept (no redirect infra) with "formerly named" notes
  • Dictionary misses now throw (Dictionary entry ... cannot be found) for missing default-locale entries in dev and prod; missing target-locale translations fall back to the source entry
  • id no longer affects the translation hash (descriptive platform metadata only)
  • $context/$locale sugar options (bare context and $_locales removed)
  • CLI/compiler: legacyGtReactImportSource parsing flag documented; GTRuntime section added to core docs

Corrections to the internal notes (intentionally NOT applied)

  • The GT class is not target-locale agnostic (targetLocale remains) and keeps its formatting methods
  • gt-i18n/fallbacks was not removed
  • useGT() works in RSC (unwraps getGT() via use())
  • Dictionary misses throw in production too — there is no warn-and-return-empty-string path
  • getGTClass()/useGTClass() return a GTRuntime (full runtime surface), not a translate-only class

Follow-ups (out of scope here)

  • Pages Router helpers (withGTServerSideProps, parseLocale, getTranslationsSnapshot) have no docs home yet — no existing Pages Router surface to extend
  • Odysseus devlog entry once final versions ship
  • Consider renaming the two type page slugs once a redirects mechanism exists

Verification

  • scripts link validator passes (438 files)
  • CI unsafe-pattern greps pass
  • pnpm build:content passes (498 pages, including the new Link page)

🤖 Generated with Claude Code

Updates docs and templates to match the odysseus release across gt-next,
gt-react, gt-react-native, gt-tanstack-start, gt-node, gt-i18n, and
generaltranslation. All changes verified against the odysseus branch source.

- gt-next: remove gt-next/client, trim gt-next/server to server-only
  exports, GTProvider props reduced to children, env-var-only credentials,
  renderSettings timeout-only, headers/cookies config, new <Link> page,
  Cache Components requirements, SSG cleanup
- gt-react: initializeGT()/initializeGTSPA() setup, GTProvider requires
  locale + translations snapshot, no loading states, Vite env credentials
- gt-react-native: named plugin export, initializeGT in app entry,
  GTProvider fallback prop, quickstart fixes
- gt-tanstack-start: getTranslationsSnapshot(locale) + parseLocale loader
  flow, re-exported gt-react surface
- Types: InlineTranslationOptions -> GTTranslationOptions,
  DictionaryTranslationOptions -> TranslationVariables (slugs kept),
  $context/$locale sugar options
- Dictionary miss now throws for missing default-locale entries; missing
  target-locale translations fall back to source
- id no longer affects the translation hash
- CLI/compiler: legacyGtReactImportSource parsing flag

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ErnestM1234
ErnestM1234 requested a review from a team as a code owner July 3, 2026 22:33
Setup now differs fundamentally between the two rendering models, so each
gets its own quickstart. Also cross-references all quickstarts against the
official gt-test-apps (odysseus) and fixes drift found there.

- react: new tutorials/quickstart-spa (initializeGTSPA entry-split pattern,
  compiler plugin step, no provider) and tutorials/quickstart-ssr
  (initializeGT + getTranslationsSnapshot loader + GTProvider); index.mdx
  is now a chooser page; nav updated (removes dangling quickstart entry)
- tanstack-start: install/import from gt-tanstack-start only, root route
  uses component + Outlet, explicit initializeGT params, selective SSR
  section, correct dev port
- next: html lang={await getLocale()} in quickstart layout,
  cache-components auto-detected getLocale/getRegion pattern and fence
  fixes, ssg anchor that the shipped gt-next warning deep-links to
- node: middleware examples use getRequestLocale(req)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ErnestM1234

Copy link
Copy Markdown
Contributor Author

Follow-up pushed (5f491e2): split the React quickstart into separate SPA and server-rendered guides (SPA needs no GTProvider; SSR loads a snapshot in the route loader), and cross-referenced all quickstarts against the official gt-test-apps (odysseus):

  • react: tutorials/quickstart-spa (entry-split initializeGTSPA pattern + compiler plugin step, per base/vite-react/base/webpack-react) and tutorials/quickstart-ssr (initializeGT + getTranslationsSnapshot + GTProvider, per base/tanstack-start); react/index is now a chooser page
  • tanstack-start: install/import from gt-tanstack-start only, component: + <Outlet /> root route, explicit initializeGT params, selective SSR section
  • next: <html lang={await getLocale()}> in the quickstart, cache-components auto-detected getLocale.ts/getRegion.ts pattern, added the #ssg-custom-get-locale anchor that the shipped gt-next warning links to
  • node: middleware examples now use getRequestLocale(req)

Flagged for test-apps maintainers: base/next-app-router-locale-routing-ssg has no getRegion.ts (library source suggests SSG needs one), and base/next-app-router-dictionary / base/gt-node-express are referenced in the README but absent. The base/next-pages-router app demonstrates a complete withGTServerSideProps + GTProvider Pages Router pattern that still has no docs home.

The odysseus branch removed getGTClass/useGTClass and the legacy initGT
alias, replacing the locale-alias use case with a standalone
resolveCanonicalLocale() helper.

- locale-aliases: use resolveCanonicalLocale from gt-next instead of
  getGTClass().resolveCanonicalLocale()
- with-gt-config: drop the initGT legacy callout and frontmatter mention

Verified no docs reference the other removals (useVersionId, gt-next/types,
generaltranslation/core, gt-i18n/fallbacks, useShouldTranslate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ErnestM1234

Copy link
Copy Markdown
Contributor Author

Updated for the latest odysseus push (a9d321a..1f53e42, the API-surface cleanup PRs #1815–#1824):

  • locale-aliases guide: getGTClass() was removed from the public API — examples now use the new standalone resolveCanonicalLocale() from gt-next (verified exported from the server, client, and RSC entries)
  • with-gt-config: removed the initGT legacy callout (the alias is gone)

Audited the rest of the cleanup against the docs — no other pages referenced the removals (useGTClass, useVersionId, gt-next/types, generaltranslation/core, gt-i18n/fallbacks, useShouldTranslate), and the documented type names (GTTranslationOptions, TranslationVariables, DictionaryEntryOptions) and GTRuntime/gt-node/gt-tanstack-start surfaces are unchanged. Note: gt-i18n/fallbacks is now actually removed (it still existed at the previous snapshot), matching the original internal notes.

Links, CI greps, and the content build (500 pages) all pass.

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