Skip to content

feat: Add i18n for tanstack start - #762

Open
aXenDeveloper wants to merge 2 commits into
feat/tanstack_start_2from
feat/tanstack_start_3
Open

feat: Add i18n for tanstack start#762
aXenDeveloper wants to merge 2 commits into
feat/tanstack_start_2from
feat/tanstack_start_3

Conversation

@aXenDeveloper

Copy link
Copy Markdown
Owner

Improving Documentation

Description

What?

Why?

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
vitnode-docs Ready Ready Preview Aug 27, 2026 1:52pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d45285ba7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/server/locale.server.ts Outdated
Comment on lines +60 to +61
const redirectTo = localeRouting.redirectPathnameFor(pathname)
if (redirectTo !== undefined) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the locale when issuing canonical redirects

When a locale-prefixed request itself requires a redirect, this early return bypasses the later cookie logic. For example, a first-time Polish visitor requesting /pl/admin is redirected to /admin without a vitnode_locale=pl cookie, so the destination resolves to English; similarly, /en does not replace an existing Polish preference. Attach the explicit source locale's cookie to the redirect response before returning.

Useful? React with 👍 / 👎.

* `invalidate()` then re-runs the matched routes. Two reasons: the internal URL
* did not change, so nothing looks stale to the router even though every loader
* that read `context.locale` now holds the previous answer - and on an ignored
* route such as `/admin`, where the URL does not change at all, it is the whole

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent stale language switches from winning

If a visitor selects two languages quickly, each invocation waits independently for its message request before navigating. A slow first selection can therefore complete after a faster second selection and overwrite the URL with the language the visitor no longer chose; the cookie, written immediately by the second selection, can then disagree with the rendered locale. Serialize switches or discard a completion when it is no longer the latest request.

Useful? React with 👍 / 👎.

Comment thread apps/web/src/lib/i18n/query.ts Outdated
Comment on lines +47 to +49
const requested = normalizeNamespaces(namespaces)

if (requested.length > MAX_NAMESPACES) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject oversized namespace arrays before normalizing them

For a public server-function request containing a very large namespace array, normalization constructs a Set and sorts the values before the 16-item limit is checked. Arrays containing thousands of repeated names also normalize below the limit and are accepted, defeating the stated bound while still consuming work and memory. Validate the raw array's length before de-duplication and sorting.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1e61056ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +296 to +298
locales: i18n.locales
.filter(locale => locale.enabled !== false)
.map(locale => locale.code),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject a disabled default locale

When the locale marked as defaultLocale also has enabled: false, this filter removes it from the supported set while preserving it as the default. The resulting router can return a locale for which isSupportedLocale is false; with localePrefix: "always", it also leaves / unprefixed because prefixFor(defaultLocale) treats the default as unsupported. Since VitNodeI18nConfig permits this configuration, either retain the default locale or reject the configuration explicitly.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 Feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant