fix(cli): stamp configured default locale on docs ledger manifest - #17531
Merged
thesandlord merged 1 commit intoAug 26, 2026
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This was referenced Aug 26, 2026
Contributor
|
Ported the one case these tests don't cover from the now-closed #17536: a non-English default plus a real Test only, no production code, targeting this branch: #17539 |
thesandlord
approved these changes
Aug 26, 2026
thesandlord
deleted the
devin/1787702962-cli-default-locale-manifest-key
branch
August 26, 2026 18:00
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.
Description
The ledger publish path hardcoded
"en"as the locale key for the base (default-locale) segment.buildLedgerInputdefaulted itslocaleparameter to"en"and the base call site never passed one, so a site whosedocs.ymldeclarespublished
defaultLocale: "en"andlocales: { en: {...}, "pt-BR": {...} }— the non-default translations kept their real tags (that call site already passeslocale), only the base entry was flattened.publishInput.defaultLocaleis derived frombaseLocale.locale, so it inherited the same wrong value.A reader that looks up the tag it read from
docs.yml(en-US) missesmanifest.locales. The Next.js reader survives vialedgerManifestClient's fallback chain (requested locale →manifest.defaultLocale→ first published locale); the Astro static build had no such fallback and threw, emitting a docs site with zero routes that still deployed.The configured default is already on the payload
publishDocsLedgerreceives:DocsDefinitionResolver.getDocsTranslationsConfig()writes it todocsDefinition.config.translations.defaultLocale, so no new parameter or plumbing is needed.Existing published manifests still key their base segment as
en, so reader-side fallbacks must stay in place; this is not a breaking change for them.Changes Made
buildLedgerInputresolves the segment locale aslocale ?? docsDefinition.config.translations?.defaultLocale ?? "en"— the base segment (and thereforepublishInput.defaultLocale) now uses the configured default, translation segments keep the explicit locale they already pass, and sites with notranslationsblock still publish"en"unchanged.packages/cli/cli/changes/unreleased/.Testing
buildLedgerInput.test.ts:en-USdefault keys the base entryen-US; ade-DEdefault is preserved; an explicitpt-BRtranslation locale round-trips; notranslationsblock still yieldsen.Deliberately out of scope: any change in fern-api/fern-platform (the Astro reader fallback is fern-platform#14141), locale-tag validation, and the FDR V2→ledger automigration path.
Link to Devin session: https://app.devin.ai/sessions/4868e3907f9843dd9edca82754a8fcd6
Requested by: @Ryan-Amirthan