Repository navigation
Conversation
Wires gt-next into the app and localizes every user-facing string in the
landing page and the chat interface. Dev pages (/eval, /ablation, /metrics,
/storage) are deliberately left untranslated.
Setup:
- withGTConfig wraps next.config.ts; existing turbopack/webpack/WASM options
are unchanged
- gt.config.json: source en, targets es/fr/de/ja/zh, output public/_gt/
(gitignored, generated)
- src/loadTranslations.ts returns {} on a miss, so the app runs untranslated
when no translation files exist
- GTProvider + <html lang={useLocale()}> in the root layout, LocaleSelector in
the landing nav, generateMetadata() for the page title/description
Strings:
- JSX prose uses <T>, plain strings use useGT(), counts use <Plural>/<Num>,
interpolation uses ICU {name} placeholders
- src/lib/llm.ts error text is declared with msg() and decoded at the render
site, so the English-keyword matchers in chatUtils keep working regardless
of locale
- Technical identifiers (rag/agent, provider names, AST node kinds) and
byok-vault's getUserMessage are left as-is
228 strings extracted. Verified end to end: built, served, and requested with
Accept-Language: es against sentinel translations — html lang, gt() strings,
<T> blocks and <title> all resolved; English requests unaffected.
Known trade-off: GTProvider reads request headers/cookies, which turns the
five previously static routes into server-rendered-on-demand. A client-side
provider restores static output but breaks locale detection, since gt-next
exposes no public way to initialize its I18nConfig in the browser.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires
gt-nextinto the app and localizes every user-facing string in the landing page and the chat interface. Dev pages (/eval,/ablation,/metrics,/storage) are deliberately left untranslated.Setup
withGTConfigwrapsnext.config.ts; existing turbopack/webpack/WASM options unchangedgt.config.json— sourceen, targetses/fr/de/ja/zh, outputpublic/_gt/(gitignored, generated)src/loadTranslations.tsreturns{}on a miss, so the app runs untranslated when no translation files existGTProvider+<html lang={useLocale()}>in the root layout,LocaleSelectorin the landing nav,generateMetadata()for title/descriptionnpm run gt:generate/npm run gt:translateStrings (228 extracted)
<T>, plain strings useuseGT(), counts use<Plural>/<Num>, interpolation uses ICU{name}placeholderssrc/lib/llm.tserror text is declared withmsg()and decoded at the render site, so the English-keyword matchers inchatUtilskeep working regardless of localerag/agent, provider names, AST node kinds) andbyok-vault'sgetUserMessage(third-party)Verification
Built, served, and requested with
Accept-Language: esagainst hand-written sentinel translations:<html lang="es">— locale detection from request headers worksgt()strings, the<T>hero block (nested<br/>preserved), and<title>all resolved to the sentinelsThe
msg()/m()path is verified by implementation + catalog rather than in-browser:useMessagesdelegates a plain string straight togt()(the path proven above), and the lib strings are confirmed present in the generated catalog.Known trade-off
GTProviderreads request headers/cookies, which turns five previously static routes (/,/ablation,/eval,/metrics,/storage) into server-rendered-on-demand. Measured againstmainto confirm.A client-side provider was built and tested: it restores static output exactly, but locale detection silently stops working —
isLocaleSupported/getDefaultLocaleread gt-i18n'sI18nConfigsingleton, which gt-next only initializes through its server provider, and gt-next exports no public client initializer. Making it work needsinitializeGTSPAfromgt-react(an undeclared transitive dep) plusgt-i18n/internal/cookies, so it was not shipped.These pages do their real work in the browser, so the dynamic routes serve a thin HTML shell — the cost is CDN caching of that shell, not compute.
Pre-Landing Review
2 issues (0 critical, 2 informational).
src/app/[owner]/[repo]/page.tsx:1118—shouldSuggestGitHubToken(toastMessage)matches English keywords, but several toasts are now translated at set-time, so the "Get a token" hint becomes locale-dependent. Same coupling at:408,:422,:990viashouldPromptForLLMSettings. Fix: carry a structured flag instead of re-sniffing text.src/app/[owner]/[repo]/page.tsx:262,299,492,519,643—gtused inside these callbacks/effects without being in their dependency arrays. Moot in practice (GT'ssetLocaletriggers a full page reload), but worth tidying.Test plan
npm run test:ci— 53 tests, 7 files, 0 failuresnpm run typecheck— cleannpm run build— succeedsGT_PROJECT_ID+GT_API_KEY, thennpm run gt:translateNote:
buildwas intentionally left as-is rather than becominggt translate && next build, since that would break any build without a GT API key.🤖 Generated with Claude Code