[PR #7866] [MERGED] feat(i18n): pass GenericEndpointContext to getLocale callback #7599

Closed
opened 2026-03-13 13:42:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7866
Author: @bytaesu
Created: 2/8/2026
Status: Merged
Merged: 2/10/2026
Merged by: @himself65

Base: canaryHead: 2026-02-09/feat/i18n-getlocale-endpoint-context


📝 Commits (1)

  • ef86816 feat(i18n): pass GenericEndpointContext to getLocale callback

📊 Changes

4 files changed (+30 additions, -33 deletions)

View changed files

📝 docs/content/docs/plugins/i18n.mdx (+7 -7)
📝 packages/i18n/src/i18n.test.ts (+3 -4)
📝 packages/i18n/src/index.ts (+13 -16)
📝 packages/i18n/src/types.ts (+7 -6)

📄 Description

Note

This is a breaking change, but it only exists in the beta version.

Related to https://github.com/better-auth/better-auth/issues/7805#issuecomment-3863889055


Summary by cubic

Pass GenericEndpointContext to the i18n getLocale callback to provide full endpoint data and simplify detection across runtimes. This changes the getLocale signature and is breaking in beta.

  • Migration
    • Change getLocale from (request, ctx) => ... to (ctx) => ...
    • Use ctx.headers for headers, ctx.request for the Request, and ctx.context.session for the user.
    • Remember ctx.request may be undefined for non-HTTP calls.

Written for commit ef86816474. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7866 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/8/2026 **Status:** ✅ Merged **Merged:** 2/10/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `2026-02-09/feat/i18n-getlocale-endpoint-context` --- ### 📝 Commits (1) - [`ef86816`](https://github.com/better-auth/better-auth/commit/ef86816474217ed3f9f3d225d72963b34982d76b) feat(i18n): pass GenericEndpointContext to getLocale callback ### 📊 Changes **4 files changed** (+30 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/i18n.mdx` (+7 -7) 📝 `packages/i18n/src/i18n.test.ts` (+3 -4) 📝 `packages/i18n/src/index.ts` (+13 -16) 📝 `packages/i18n/src/types.ts` (+7 -6) </details> ### 📄 Description > [!NOTE] > This is a breaking change, but it only exists in the beta version. Related to https://github.com/better-auth/better-auth/issues/7805#issuecomment-3863889055 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Pass GenericEndpointContext to the i18n getLocale callback to provide full endpoint data and simplify detection across runtimes. This changes the getLocale signature and is breaking in beta. - **Migration** - Change getLocale from (request, ctx) => ... to (ctx) => ... - Use ctx.headers for headers, ctx.request for the Request, and ctx.context.session for the user. - Remember ctx.request may be undefined for non-HTTP calls. <sup>Written for commit ef86816474217ed3f9f3d225d72963b34982d76b. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:42:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7599