fix: preserve proper nouns in diagnostic reasons - #2018
Merged
Conversation
eoinest
enabled auto-merge (squash)
August 1, 2026 00:37
archie-mckenzie
approved these changes
Aug 1, 2026
Contributor
size-limit report 📦
|
Merged
eoinest
pushed a commit
that referenced
this pull request
Aug 5, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## gt@2.16.1 ### Patch Changes - [#2019](#2019) [`60d154c`](60d154c) Thanks [@eoinest](https://github.com/eoinest)! - Save local edits before translation by default, with a `--no-save-local` flag to opt out. - [#2028](#2028) [`8066d0a`](8066d0a) Thanks [@eoinest](https://github.com/eoinest)! - Stop the setup wizard at monorepo workspace roots and direct users to run it from the app they want to localize. - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 - @generaltranslation/python-extractor@0.2.34 - @generaltranslation/supported-locales@2.1.14 ## @generaltranslation/compiler@1.3.36 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 ## generaltranslation@9.1.1 ### Patch Changes - [#2018](#2018) [`9b3eb92`](9b3eb92) Thanks [@eoinest](https://github.com/eoinest)! - Preserve proper-noun casing when diagnostic reasons are combined into user-facing messages. ## gtx-cli@2.16.1 ### Patch Changes - Updated dependencies [[`60d154c`](60d154c), [`8066d0a`](8066d0a)]: - gt@2.16.1 ## gt-i18n@1.0.11 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 ## locadex@1.0.204 ### Patch Changes - Updated dependencies [[`60d154c`](60d154c), [`8066d0a`](8066d0a)]: - gt@2.16.1 ## gt-next@11.1.5 ### Patch Changes - [#2018](#2018) [`9b3eb92`](9b3eb92) Thanks [@eoinest](https://github.com/eoinest)! - Preserve proper-noun casing when diagnostic reasons are combined into user-facing messages. - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 - @generaltranslation/react-core@11.1.5 - @generaltranslation/compiler@1.3.36 - gt-i18n@1.0.11 - gt-react@11.1.5 ## gt-node@1.0.12 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 - gt-i18n@1.0.11 ## @generaltranslation/python-extractor@0.2.34 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 ## gt-react@11.1.5 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 - @generaltranslation/react-core@11.1.5 - gt-i18n@1.0.11 ## @generaltranslation/react-core@11.1.5 ### Patch Changes - [#2018](#2018) [`9b3eb92`](9b3eb92) Thanks [@eoinest](https://github.com/eoinest)! - Preserve proper-noun casing when diagnostic reasons are combined into user-facing messages. - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 - gt-i18n@1.0.11 ## gt-react-native@11.1.5 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 - @generaltranslation/react-core@11.1.5 - gt-i18n@1.0.11 - @generaltranslation/supported-locales@2.1.14 ## gt-sanity@3.1.3 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 ## @generaltranslation/supported-locales@2.1.14 ### Patch Changes - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 ## gt-tanstack-start@11.1.5 ### Patch Changes - [#2010](#2010) [`8436d54`](8436d54) Thanks [@eoinest](https://github.com/eoinest)! - Export `gtMiddleware` from the browser condition so TanStack Start client builds can evaluate application setup files that register it. - Updated dependencies [[`9b3eb92`](9b3eb92)]: - generaltranslation@9.1.1 - @generaltranslation/react-core@11.1.5 - gt-i18n@1.0.11 - gt-react@11.1.5 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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
Next.jsare not lowercased.gt-nextwarning while keeping prior diagnostic output unchanged.Testing
pnpm build— passed (20 packages)pnpm --filter generaltranslation test— passed (31 files, 499 tests)pnpm --filter gt-next test:js— passed (25 files, 273 tests)pnpm --filter @generaltranslation/react-core test— passed (11 files, 46 tests)pnpm --filter gt-next exec vitest run src/errors/__tests__/createErrors.test.ts— passed (1 file, 3 tests)pnpm exec oxlint <changed TypeScript files>— passedpnpm exec oxfmt --check <changed files>— passedNotes
whyclause lowercases proper nouns: "because next.js may select a locale" #2016.generaltranslation,@generaltranslation/react-core, andgt-next.Greptile Summary
This PR fixes a bug in
createDiagnosticMessagewhere thelowercaseFirstWordhelper was incorrectly downcasing proper nouns (e.g.Next.js→next.js) when combiningwhyclauses into a single sentence. The fix removeslowercaseFirstWordentirely and shifts the responsibility to each call site, which must now authorwhystrings as sentence fragments using their intended in-sentence casing.diagnostics.ts: RemoveslowercaseFirstWord;whyandwayOutclauses are now passed directly tostripSentence. ThewayOutpath is effectively a no-op change sinceshouldCombineWayOutalready requiredwayOutto start with a lowercase letter via/^[a-z]/.client.ts,createErrors.ts,ssg.ts,singleton-operations.ts): Existingwhyclauses that started with common English words (This,The,Static,Without) are lowercased to match the new convention.diagnostics.test.tsandcreateErrors.test.tsverify thatNext.jscasing is preserved end-to-end, and that thecreateNextI18nConfigMismatchWarninghelper produces the correct full message string.Confidence Score: 5/5
Safe to merge — the change is narrow, well-tested, and all call sites have been updated to the new convention.
The removal of lowercaseFirstWord is clean: the why path is the only place producing wrong output, all affected call sites have been updated to lowercase-start fragments, and a grep across the monorepo confirms no remaining why clause would produce an awkward combined sentence. The wayOut removal is provably inert because shouldCombineWayOut already gates on the clause starting lowercase. New tests cover both the core utility and the specific createNextI18nConfigMismatchWarning entry point that triggered the issue.
Files Needing Attention: No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["createDiagnosticMessage(input)"] --> B{why provided?} B -- Yes --> C["stripSentence(whatHappened) + ' because ' + stripSentence(why)"] B -- No --> D["whatHappened as-is"] C --> E{fix AND wayOut AND wayOut starts with a-z?} D --> E E -- Yes --> F["stripSentence(fix) + ', or ' + stripSentence(wayOut)"] E -- No --> G["fix as-is"] F --> H["Assemble parts via ensureSentence and join"] G --> H H --> I["Add source/severity prefix"] I --> J["Final diagnostic string"]Reviews (1): Last reviewed commit: "fix: preserve proper nouns in diagnostic..." | Re-trigger Greptile