[PR #7431] [MERGED] docs(i18n): remove defaultLocale from examples #15555

Closed
opened 2026-04-13 10:05:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7431
Author: @Copilot
Created: 1/17/2026
Status: Merged
Merged: 1/17/2026
Merged by: @himself65

Base: himself65/2026/01/16/i18nHead: copilot/sub-pr-7428-again


📝 Commits (2)

  • 8211df7 Initial plan
  • 20dd86d docs: remove defaultLocale from i18n examples

📊 Changes

2 files changed (+0 additions, -3 deletions)

View changed files

📝 docs/content/docs/plugins/i18n.mdx (+0 -2)
📝 packages/i18n/src/index.ts (+0 -1)

📄 Description

Removed redundant defaultLocale: "en" from i18n plugin examples in documentation and code comments.

Changes

  • Removed defaultLocale from installation example in docs
  • Removed defaultLocale from detection strategies example in docs
  • Removed defaultLocale from JSDoc code example
  • Kept defaultLocale option documentation section (documents available feature)

Rationale

The parameter is optional with smart defaults: uses "en" if present in translations, otherwise first available locale. Showing it in basic examples implies it's required when it's not.

Before:

i18n({
    translations: {
        fr: { USER_NOT_FOUND: "Utilisateur non trouvé" },
        de: { USER_NOT_FOUND: "Benutzer nicht gefunden" },
    },
    defaultLocale: "en",  // Redundant - "en" is auto-selected if available
})

After:

i18n({
    translations: {
        fr: { USER_NOT_FOUND: "Utilisateur non trouvé" },
        de: { USER_NOT_FOUND: "Benutzer nicht gefunden" },
    },
})

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Summary by cubic

Removed defaultLocale from i18n docs examples and sample code comments to encourage explicit locale selection. Addresses feedback in #7428; defaultLocale remains a supported option.

Written for commit 20dd86df66. 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/7431 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 1/17/2026 **Status:** ✅ Merged **Merged:** 1/17/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `himself65/2026/01/16/i18n` ← **Head:** `copilot/sub-pr-7428-again` --- ### 📝 Commits (2) - [`8211df7`](https://github.com/better-auth/better-auth/commit/8211df790a09673d5653de3c2d247723437abe05) Initial plan - [`20dd86d`](https://github.com/better-auth/better-auth/commit/20dd86df6635923788e8b93bbe99cc015d136e12) docs: remove defaultLocale from i18n examples ### 📊 Changes **2 files changed** (+0 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/i18n.mdx` (+0 -2) 📝 `packages/i18n/src/index.ts` (+0 -1) </details> ### 📄 Description Removed redundant `defaultLocale: "en"` from i18n plugin examples in documentation and code comments. ## Changes - Removed `defaultLocale` from installation example in docs - Removed `defaultLocale` from detection strategies example in docs - Removed `defaultLocale` from JSDoc code example - Kept `defaultLocale` option documentation section (documents available feature) ## Rationale The parameter is optional with smart defaults: uses "en" if present in translations, otherwise first available locale. Showing it in basic examples implies it's required when it's not. **Before:** ```ts i18n({ translations: { fr: { USER_NOT_FOUND: "Utilisateur non trouvé" }, de: { USER_NOT_FOUND: "Benutzer nicht gefunden" }, }, defaultLocale: "en", // Redundant - "en" is auto-selected if available }) ``` **After:** ```ts i18n({ translations: { fr: { USER_NOT_FOUND: "Utilisateur non trouvé" }, de: { USER_NOT_FOUND: "Benutzer nicht gefunden" }, }, }) ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed defaultLocale from i18n docs examples and sample code comments to encourage explicit locale selection. Addresses feedback in #7428; defaultLocale remains a supported option. <sup>Written for commit 20dd86df6635923788e8b93bbe99cc015d136e12. 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-04-13 10:05:54 -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#15555