Skip to content

fix: apply style guide to error messages and warnings (extended)#1076

Merged
archie-mckenzie merged 3 commits intogeneraltranslation:mainfrom
moss-bryophyta:moss/style-guide-errors-v2
Mar 7, 2026
Merged

fix: apply style guide to error messages and warnings (extended)#1076
archie-mckenzie merged 3 commits intogeneraltranslation:mainfrom
moss-bryophyta:moss/style-guide-errors-v2

Conversation

@moss-bryophyta
Copy link
Copy Markdown
Contributor

@moss-bryophyta moss-bryophyta commented Mar 5, 2026

Extends #1074 with a comprehensive pass across the entire monorepo.

Changes

Style guide compliance (29 files)

  • Remove "Please" from all error/warning messages (direct voice)
  • Remove "You are using/attempting" patterns (active voice)
  • in-lineinline in CLI messages
  • Simplify verbose messages while preserving meaning
  • Use present tense where appropriate

Bug fixes (from main, not yet in #1074)

  • will like fallbackwill likely fall back
  • Capitalize sentence starts (no localesNo locales)

Packages touched

  • next (errors/cacheComponents, errors/createErrors, errors/ssg)
  • react-core (errors-dir/createErrors)
  • cli (console/index, console/logging, setup, config, formats, workflows, utils)
  • compiler (state/StringCollector)
  • locadex (logging/console)
  • sanity (serialization/serialize)

Summary by CodeRabbit

  • Chores
    • Updated user-facing messages throughout the CLI and SDK for improved clarity and consistency. Messages now use more direct phrasing by removing redundant words and adjusting wording for a cleaner tone. Minor text corrections, including spelling standardization.

Greptile Summary

This PR extends #1074 with a comprehensive, monorepo-wide style guide pass across 29 files, applying direct voice to all error and warning messages (removing "Please", "You are using/attempting" patterns, in-lineinline) while also fixing two correctness issues from main: the typo "will like fallback""will likely fall back" and a missing sentence-start capitalisation in ssg.ts.

Key changes:

  • Style guide compliance applied consistently across packages/next, packages/react-core, packages/cli, packages/compiler, packages/locadex, and packages/sanity
  • Bug fix: createSsrFunctionDuringSsgWarning in ssg.ts corrects a long-standing typo and now ends with a period for consistency
  • Pre-existing inconsistency in react-core: customLoadDictionaryWarning uses Error: prefix but should use Warning: to match the function name and align with the corresponding function in packages/next; since the file is touched by this PR it would be a low-cost fix to correct here

Confidence Score: 4/5

  • This PR is safe to merge. All changes are pure string literal modifications with no logic or type signature changes.
  • Safe to merge with minor action item: one function in react-core named customLoadDictionaryWarning uses "Error:" prefix instead of "Warning:", which should be corrected while the file is open. The file is already being edited in this PR, making this a low-cost fix. All other style guide changes are correct and consistent.
  • packages/react-core/src/errors-dir/createErrors.ts — change "Error:" to "Warning:" in customLoadDictionaryWarning to match function name and the corresponding function in packages/next

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph packages["Packages with updated messages"]
        CLI["packages/cli<br/>(console/index, logging,<br/>base, react, config,<br/>formats, fs, locadex,<br/>setup, translation,<br/>utils, workflows)"]
        NEXT["packages/next<br/>(errors/cacheComponents,<br/>errors/createErrors,<br/>errors/ssg)"]
        RC["packages/react-core<br/>(errors-dir/createErrors)"]
        COMP["packages/compiler<br/>(state/StringCollector)"]
        LOC["packages/locadex<br/>(logging/console)"]
        SAN["packages/sanity<br/>(serialization/serialize)"]
    end

    subgraph changes["Style Changes Applied"]
        P["Remove 'Please'"]
        Y["Remove 'You are using/attempting'"]
        IL["in-line → inline"]
        TF["Typo fix: 'will like fallback'<br/>→ 'will likely fall back'"]
        CAP["Capitalise sentence starts"]
    end

    CLI --> P & Y & IL
    NEXT --> P & Y & TF & CAP
    RC --> P & Y
    COMP --> Y
    LOC --> P
    SAN --> P
Loading

Last reviewed commit: 134fa69

Greptile also left 1 inline comment on this PR.

- Use direct, active voice: remove "Please", "You are using/attempting"
- "in-line" → "inline" in CLI messages
- Remove filler words and indirect phrasing
- Use present tense instead of future where appropriate
- Simplify verbose messages while preserving meaning

Files changed across: next, react-core, cli, compiler, sanity, locadex
@moss-bryophyta moss-bryophyta requested a review from a team as a code owner March 5, 2026 23:18
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

This PR systematically rewrites user-facing error messages, prompts, and warnings across 26+ files to remove "Please" and use more direct, concise phrasing. All changes are string literal modifications only, with no alterations to logic, control flow, or public API signatures.

Changes

Cohort / File(s) Summary
CLI Commands & Base
packages/cli/src/cli/base.ts, packages/cli/src/cli/commands/upload.ts, packages/cli/src/cli/react.ts
Removed "Please" from user prompts and error messages in file glob input, upload errors, and formatting success messages.
Configuration & Setup
packages/cli/src/config/generateSettings.ts, packages/cli/src/config/validateSettings.ts, packages/cli/src/setup/userInput.ts, packages/cli/src/setup/wizard.ts
Shortened validation and setup prompts by removing "Please" and condensing locale/configuration error messages.
Console & Logging
packages/cli/src/console/index.ts, packages/cli/src/console/logging.ts, packages/locadex/src/logging/console.ts
Updated re-exported error constants and logging messages to use shorter, more direct phrasing (e.g., "Provide a…" instead of "Please provide a…").
Format Handlers
packages/cli/src/formats/files/aggregateFiles.ts, packages/cli/src/formats/json/mergeJson.ts, packages/cli/src/formats/json/parseJson.ts
Shortened error and warning messages when files or JSON schema elements are not found; changed "Please check" to "Check".
Framework & Utilities
packages/cli/src/fs/determineFramework.ts, packages/cli/src/locadex/setupFlow.ts, packages/cli/src/utils/addExplicitAnchorIds.ts, packages/cli/src/utils/packageManager.ts
Reworded framework detection, setup flow, and utility warning messages to remove "Please" and shorten directives.
Installation & Translation
packages/cli/src/utils/installPackage.ts, packages/cli/src/translation/stage.ts, packages/cli/src/translation/validate.ts
Updated package installation guidance and corrected "in-line" → "inline" in translation error messages.
Workflows
packages/cli/src/react/parse/addVitePlugin/index.ts, packages/cli/src/react/parse/addVitePlugin/updateViteConfig.ts, packages/cli/src/workflows/steps/BranchStep.ts
Condensed error messages for Vite plugin configuration and branch handling; removed "Please" from instructions.
Compiler
packages/compiler/src/state/StringCollector.ts
Updated error message describing counterId behavior in content registration.
Next.js Error Messages
packages/next/src/errors/cacheComponents.ts, packages/next/src/errors/createErrors.ts, packages/next/src/errors/ssg.ts
Rewrote multiple warning/error constants to use consistent, concise phrasing; removed redundant phrases and clarified conditions.
React Core Errors
packages/react-core/src/errors-dir/createErrors.ts
Updated error messages for authentication, custom loaders, and locale validation to use shorter phrasing.
Sanity Serialization
packages/sanity/src/serialization/serialize/index.ts
Shortened serialization error message by removing "Please specify".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • refactor(cli): add gt package #1069: Modifies user-facing string literals in overlapping CLI source files, particularly in packages/cli/src/cli/base.ts and packages/cli/src/console/index.ts, indicating a coordinated effort to refine CLI messaging.

Suggested reviewers

  • archie-mckenzie

Poem

🐰 Hop, hop! The messages now shine bright,
"Please" hopped away—directness takes flight,
From verbose to concise, each user command gleams,
Swift instruction and clarity reign supreme! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and directly describes the main change: applying a style guide to error messages and warnings across the repository (extended pass).
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (5)
packages/compiler/src/state/StringCollector.ts (1)

74-74: Use direct active voice to match the style guide

Line 74 still uses the “you are trying” pattern. Consider rewriting to a direct active message for consistency with this PR’s style goal.

Proposed wording update
-        'Cannot have a counterId of -1. This likely means you are trying to register content from a namespace method invocation.'
+        'Cannot use counterId -1. Namespace method invocation likely registered content.'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/compiler/src/state/StringCollector.ts` at line 74, The error message
in StringCollector.ts that reads 'Cannot have a counterId of -1. This likely
means you are trying to register content from a namespace method invocation.'
should be rewritten in direct active voice; update the string (used in
StringCollector) to something like "A counterId of -1 indicates registration of
content from a namespace method invocation." so it follows the PR's style guide
and preserves the same semantics.
packages/cli/src/formats/json/parseJson.ts (1)

148-151: Consider updating this message for style guide consistency.

Line 149 uses "You must specify..." which could be simplified to direct voice (e.g., "Specify a source item where its key matches the default locale"). This aligns with the PR's goal of removing "You are using/attempting" patterns.

♻️ Optional: Update to direct voice
       if (!matchingItem.sourceItem) {
         logger.error(
-          `Source item not found at path: ${sourceObjectPointer}. You must specify a source item where its key matches the default locale`
+          `Source item not found at path: ${sourceObjectPointer}. Specify a source item where its key matches the default locale`
         );
         return exitSync(1);
       }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/formats/json/parseJson.ts` around lines 148 - 151, The
logger.error message in parseJson.ts uses indirect phrasing ("You must
specify..."); update the log string passed to logger.error (in the block that
currently references sourceObjectPointer and calls exitSync(1)) to use direct
voice — e.g., "Specify a source item where its key matches the default locale" —
keeping the same context that includes sourceObjectPointer and then call
exitSync(1) as before.
packages/cli/src/formats/json/mergeJson.ts (1)

299-304: Consider updating this message for style guide consistency.

Similar to the same message in parseJson.ts, line 301 uses "You must specify..." which could be updated to direct voice for consistency with the PR's style guide goals.

♻️ Optional: Update to direct voice
       if (!matchingDefaultLocaleItem.sourceItem) {
         logger.error(
-          `Source item not found at path: ${sourceObjectPointer}. You must specify a source item where its key matches the default locale`
+          `Source item not found at path: ${sourceObjectPointer}. Specify a source item where its key matches the default locale`
         );
         return exitSync(1);
       }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/formats/json/mergeJson.ts` around lines 299 - 304, Update
the error text logged in the block that checks
matchingDefaultLocaleItem.sourceItem (the logger.error call that references
sourceObjectPointer and calls exitSync(1)) to use a direct voice consistent with
parseJson.ts (e.g., change "You must specify a source item..." to "Specify a
source item..."); modify only the message string to match style guide tone while
keeping the same context and existing variables in the log call.
packages/cli/src/translation/validate.ts (1)

167-170: Consider centralizing this no-content message.

This text is duplicated in translation flows; extracting a shared constant/helper would reduce drift risk for future copy updates.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/translation/validate.ts` around lines 167 - 170, The "No
inline content or dictionaries were found for ${chalk.green(pkg)}..." string is
duplicated—extract it into a shared constant or formatter (e.g., export a
NO_INLINE_CONTENT_MESSAGE or formatNoContentMessage(pkg)) in a central
translation/messages module and replace the literal in validateTranslations (the
code around validate.ts that references pkg and chalk.green) and other
translation flows to import and use that single helper so future edits only
change one place.
packages/react-core/src/errors-dir/createErrors.ts (1)

39-43: Minor inconsistency: Missing quotes around locale parameter.

The locale parameter is displayed without quotes here (e.g., loadTranslations(${locale})), while the equivalent messages in packages/next/src/errors/createErrors.ts (lines 10 and 13) display it with quotes (e.g., loadTranslations("${locale}")). Consider aligning for consistency across packages.

Proposed fix
 export const customLoadTranslationsError = (locale: string = '') =>
-  `${PACKAGE_NAME} Error: Failed to fetch locally stored translations. If using a custom loadTranslations(${locale}), make sure it is correctly implemented.`;
+  `${PACKAGE_NAME} Error: Failed to fetch locally stored translations. If using a custom loadTranslations("${locale}"), make sure it is correctly implemented.`;
 
 export const customLoadDictionaryWarning = (locale: string = '') =>
-  `${PACKAGE_NAME} Error: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
+  `${PACKAGE_NAME} Warning: Failed to fetch locally stored dictionary. If using a custom loadDictionary("${locale}"), make sure it is correctly implemented.`;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-core/src/errors-dir/createErrors.ts` around lines 39 - 43,
Update the two error message factories customLoadTranslationsError and
customLoadDictionaryWarning so the locale placeholder is wrapped in quotes
(e.g., loadTranslations("...") / loadDictionary("...")) to match the style used
in packages/next; locate these functions and adjust the template strings to
include double quotes around ${locale} in both messages.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/cli/src/setup/userInput.ts`:
- Around line 21-31: The empty-input check fails because input.split(' ') always
yields at least one element; before creating localeList in the user input
validation (the code that uses localeList and gt.isValidLocale), trim the raw
input and return the "Enter at least one locale" error if trimmed input is
empty, or build localeList by splitting on whitespace and filtering out empty
strings (e.g., input.trim().split(/\s+/) or .split(' ').filter(Boolean)) so the
subsequent localeList.length check and gt.isValidLocale validations work
correctly.

In `@packages/cli/src/utils/installPackage.ts`:
- Line 83: The manual global install hint in installPackage.ts currently outputs
`npm install -g ${packageName}` and omits the optional `version`; update the
fallback string construction (where packageName is used to build the manual
command) to append `@${version}` when a version is provided so the hint becomes
`npm install -g ${packageName}@${version}` (ensure you handle empty/undefined
version to keep the original behavior). Locate the logic that produces the
messages referencing packageName (used in the installPackage utility) and modify
both occurrences to conditionally include `@${version}`.

In `@packages/next/src/errors/cacheComponents.ts`:
- Around line 21-22: The exported constant
cacheComponentsNonLocalTranslationsWarning currently contains a message prefixed
with "gt-next Error:", causing a severity mismatch; update the string value in
cacheComponentsNonLocalTranslationsWarning to use "gt-next Warning:" as the
message prefix (or alternatively rename the constant to
cacheComponentsNonLocalTranslationsError if you prefer an error-level label) so
the identifier and message severity are consistent—ensure the change is made
where cacheComponentsNonLocalTranslationsWarning is defined and any callers
still reference the same symbol.

In `@packages/react-core/src/errors-dir/createErrors.ts`:
- Around line 42-43: The exported function customLoadDictionaryWarning currently
produces a message prefixed with `${PACKAGE_NAME} Error:` which conflicts with
its "Warning" name; update the message string returned by
customLoadDictionaryWarning to use `${PACKAGE_NAME} Warning:` (preserving the
rest of the message and the locale interpolation) so the severity in the text
matches the function name and is consistent with the implementation in the other
package.

---

Nitpick comments:
In `@packages/cli/src/formats/json/mergeJson.ts`:
- Around line 299-304: Update the error text logged in the block that checks
matchingDefaultLocaleItem.sourceItem (the logger.error call that references
sourceObjectPointer and calls exitSync(1)) to use a direct voice consistent with
parseJson.ts (e.g., change "You must specify a source item..." to "Specify a
source item..."); modify only the message string to match style guide tone while
keeping the same context and existing variables in the log call.

In `@packages/cli/src/formats/json/parseJson.ts`:
- Around line 148-151: The logger.error message in parseJson.ts uses indirect
phrasing ("You must specify..."); update the log string passed to logger.error
(in the block that currently references sourceObjectPointer and calls
exitSync(1)) to use direct voice — e.g., "Specify a source item where its key
matches the default locale" — keeping the same context that includes
sourceObjectPointer and then call exitSync(1) as before.

In `@packages/cli/src/translation/validate.ts`:
- Around line 167-170: The "No inline content or dictionaries were found for
${chalk.green(pkg)}..." string is duplicated—extract it into a shared constant
or formatter (e.g., export a NO_INLINE_CONTENT_MESSAGE or
formatNoContentMessage(pkg)) in a central translation/messages module and
replace the literal in validateTranslations (the code around validate.ts that
references pkg and chalk.green) and other translation flows to import and use
that single helper so future edits only change one place.

In `@packages/compiler/src/state/StringCollector.ts`:
- Line 74: The error message in StringCollector.ts that reads 'Cannot have a
counterId of -1. This likely means you are trying to register content from a
namespace method invocation.' should be rewritten in direct active voice; update
the string (used in StringCollector) to something like "A counterId of -1
indicates registration of content from a namespace method invocation." so it
follows the PR's style guide and preserves the same semantics.

In `@packages/react-core/src/errors-dir/createErrors.ts`:
- Around line 39-43: Update the two error message factories
customLoadTranslationsError and customLoadDictionaryWarning so the locale
placeholder is wrapped in quotes (e.g., loadTranslations("...") /
loadDictionary("...")) to match the style used in packages/next; locate these
functions and adjust the template strings to include double quotes around
${locale} in both messages.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16fc2953-2cda-4beb-af4a-8a2a5f8839bf

📥 Commits

Reviewing files that changed from the base of the PR and between 6ed3c16 and 134fa69.

📒 Files selected for processing (29)
  • packages/cli/src/cli/base.ts
  • packages/cli/src/cli/commands/upload.ts
  • packages/cli/src/cli/react.ts
  • packages/cli/src/config/generateSettings.ts
  • packages/cli/src/config/validateSettings.ts
  • packages/cli/src/console/index.ts
  • packages/cli/src/console/logging.ts
  • packages/cli/src/formats/files/aggregateFiles.ts
  • packages/cli/src/formats/json/mergeJson.ts
  • packages/cli/src/formats/json/parseJson.ts
  • packages/cli/src/fs/determineFramework.ts
  • packages/cli/src/locadex/setupFlow.ts
  • packages/cli/src/react/parse/addVitePlugin/index.ts
  • packages/cli/src/react/parse/addVitePlugin/updateViteConfig.ts
  • packages/cli/src/setup/userInput.ts
  • packages/cli/src/setup/wizard.ts
  • packages/cli/src/translation/stage.ts
  • packages/cli/src/translation/validate.ts
  • packages/cli/src/utils/addExplicitAnchorIds.ts
  • packages/cli/src/utils/installPackage.ts
  • packages/cli/src/utils/packageManager.ts
  • packages/cli/src/workflows/steps/BranchStep.ts
  • packages/compiler/src/state/StringCollector.ts
  • packages/locadex/src/logging/console.ts
  • packages/next/src/errors/cacheComponents.ts
  • packages/next/src/errors/createErrors.ts
  • packages/next/src/errors/ssg.ts
  • packages/react-core/src/errors-dir/createErrors.ts
  • packages/sanity/src/serialization/serialize/index.ts

Comment on lines 21 to 31
const localeList = input.split(' ');
if (localeList.length === 0) {
return 'Please enter at least one locale';
return 'Enter at least one locale';
}
if (localeList.some((locale) => !locale.trim())) {
return 'Please enter a valid locale (e.g., es fr de)';
return 'Enter a valid locale (e.g., es fr de)';
}
for (const locale of localeList) {
if (!gt.isValidLocale(locale)) {
return 'Please enter a valid locale (e.g., es fr de)';
return 'Enter a valid locale (e.g., es fr de)';
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Empty-input check is ineffective with current splitting.

Line 22 can never be true because split(' ') returns at least one element. Blank input falls through to the wrong validation message.

Suggested fix
-      const localeList = input.split(' ');
-      if (localeList.length === 0) {
+      const localeList = input.trim().split(/\s+/).filter(Boolean);
+      if (localeList.length === 0) {
         return 'Enter at least one locale';
       }
-      if (localeList.some((locale) => !locale.trim())) {
-        return 'Enter a valid locale (e.g., es fr de)';
-      }
       for (const locale of localeList) {
         if (!gt.isValidLocale(locale)) {
           return 'Enter a valid locale (e.g., es fr de)';
         }
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const localeList = input.split(' ');
if (localeList.length === 0) {
return 'Please enter at least one locale';
return 'Enter at least one locale';
}
if (localeList.some((locale) => !locale.trim())) {
return 'Please enter a valid locale (e.g., es fr de)';
return 'Enter a valid locale (e.g., es fr de)';
}
for (const locale of localeList) {
if (!gt.isValidLocale(locale)) {
return 'Please enter a valid locale (e.g., es fr de)';
return 'Enter a valid locale (e.g., es fr de)';
}
const localeList = input.trim().split(/\s+/).filter(Boolean);
if (localeList.length === 0) {
return 'Enter at least one locale';
}
for (const locale of localeList) {
if (!gt.isValidLocale(locale)) {
return 'Enter a valid locale (e.g., es fr de)';
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/setup/userInput.ts` around lines 21 - 31, The empty-input
check fails because input.split(' ') always yields at least one element; before
creating localeList in the user input validation (the code that uses localeList
and gt.isValidLocale), trim the raw input and return the "Enter at least one
locale" error if trimmed input is empty, or build localeList by splitting on
whitespace and filtering out empty strings (e.g., input.trim().split(/\s+/) or
.split(' ').filter(Boolean)) so the subsequent localeList.length check and
gt.isValidLocale validations work correctly.

Comment on lines 42 to +43
export const customLoadDictionaryWarning = (locale: string = '') =>
`${PACKAGE_NAME} Error: fetching locally stored dictionary. If you are using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
`${PACKAGE_NAME} Error: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Inconsistency: Function name says "Warning" but message says "Error".

The function is named customLoadDictionaryWarning, but the message prefix is ${PACKAGE_NAME} Error:. This creates a mismatch between the severity implied by the function name and the actual message. Compare with packages/next/src/errors/createErrors.ts (lines 12-13) which correctly uses "Warning" for the same function.

Proposed fix
 export const customLoadDictionaryWarning = (locale: string = '') =>
-  `${PACKAGE_NAME} Error: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
+  `${PACKAGE_NAME} Warning: Failed to fetch locally stored dictionary. If using a custom loadDictionary("${locale}"), make sure it is correctly implemented.`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const customLoadDictionaryWarning = (locale: string = '') =>
`${PACKAGE_NAME} Error: fetching locally stored dictionary. If you are using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
`${PACKAGE_NAME} Error: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
export const customLoadDictionaryWarning = (locale: string = '') =>
`${PACKAGE_NAME} Warning: Failed to fetch locally stored dictionary. If using a custom loadDictionary("${locale}"), make sure it is correctly implemented.`;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-core/src/errors-dir/createErrors.ts` around lines 42 - 43, The
exported function customLoadDictionaryWarning currently produces a message
prefixed with `${PACKAGE_NAME} Error:` which conflicts with its "Warning" name;
update the message string returned by customLoadDictionaryWarning to use
`${PACKAGE_NAME} Warning:` (preserving the rest of the message and the locale
interpolation) so the severity in the text matches the function name and is
consistent with the implementation in the other package.

Comment on lines 42 to +43
export const customLoadDictionaryWarning = (locale: string = '') =>
`${PACKAGE_NAME} Error: fetching locally stored dictionary. If you are using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
`${PACKAGE_NAME} Error: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

customLoadDictionaryWarning is named for a warning but the message uses "Error:" prefix. The corresponding function in packages/next/src/errors/createErrors.ts correctly uses "Warning:" — consider aligning this to match:

Suggested change
export const customLoadDictionaryWarning = (locale: string = '') =>
`${PACKAGE_NAME} Error: fetching locally stored dictionary. If you are using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
`${PACKAGE_NAME} Error: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
export const customLoadDictionaryWarning = (locale: string = '') =>
`${PACKAGE_NAME} Warning: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/react-core/src/errors-dir/createErrors.ts
Line: 42-43

Comment:
`customLoadDictionaryWarning` is named for a warning but the message uses "Error:" prefix. The corresponding function in `packages/next/src/errors/createErrors.ts` correctly uses "Warning:" — consider aligning this to match:

```suggestion
export const customLoadDictionaryWarning = (locale: string = '') =>
  `${PACKAGE_NAME} Warning: Failed to fetch locally stored dictionary. If using a custom loadDictionary(${locale}), make sure it is correctly implemented.`;
```

How can I resolve this? If you propose a fix, please make it concise.

@archie-mckenzie archie-mckenzie merged commit 19ae4eb into generaltranslation:main Mar 7, 2026
29 of 40 checks passed
@github-actions github-actions bot mentioned this pull request Mar 7, 2026
brian-lou pushed a commit that referenced this pull request Mar 7, 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.7.1

### Patch Changes

- [#1085](#1085)
[`dad7824`](dad7824)
Thanks [@brian-lou](https://github.com/brian-lou)! - feat: Auth wizard
supports both types of key creation

- [#1082](#1082)
[`3cb3bbd`](3cb3bbd)
Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Bumping
CLI timeouts

- [#1076](#1076)
[`19ae4eb`](19ae4eb)
Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - Apply
style guide to error messages and warnings: remove "Please", simplify
verbose phrasing, fix `in-line` → `inline`.

- Updated dependencies
\[[`dad7824`](dad7824)]:
    -   generaltranslation@8.1.14

## @generaltranslation/compiler@1.1.25

### Patch Changes

- [#1076](#1076)
[`19ae4eb`](19ae4eb)
Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - Apply
style guide to error messages and warnings: remove "Please", simplify
verbose phrasing, fix `in-line` → `inline`.

- Updated dependencies
\[[`dad7824`](dad7824)]:
    -   generaltranslation@8.1.14

## generaltranslation@8.1.14

### Patch Changes

- [#1085](#1085)
[`dad7824`](dad7824)
Thanks [@brian-lou](https://github.com/brian-lou)! - feat: Auth wizard
supports both types of key creation

## gtx-cli@2.7.1

### Patch Changes

- Updated dependencies
\[[`dad7824`](dad7824),
[`3cb3bbd`](3cb3bbd),
[`19ae4eb`](19ae4eb)]:
    -   gt@2.7.1

## gt-i18n@0.4.2

### Patch Changes

- Updated dependencies
\[[`dad7824`](dad7824)]:
    -   generaltranslation@8.1.14
    -   @generaltranslation/supported-locales@2.0.47

## locadex@1.0.111

### Patch Changes

- [#1076](#1076)
[`19ae4eb`](19ae4eb)
Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - Apply
style guide to error messages and warnings: remove "Please", simplify
verbose phrasing, fix `in-line` → `inline`.

- Updated dependencies
\[[`dad7824`](dad7824),
[`3cb3bbd`](3cb3bbd),
[`19ae4eb`](19ae4eb)]:
    -   gt@2.7.1

## gt-next@6.13.5

### Patch Changes

- [#1076](#1076)
[`19ae4eb`](19ae4eb)
Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - Apply
style guide to error messages and warnings: remove "Please", simplify
verbose phrasing, fix `in-line` → `inline`.

- Updated dependencies
\[[`dad7824`](dad7824),
[`19ae4eb`](19ae4eb)]:
    -   generaltranslation@8.1.14
    -   @generaltranslation/compiler@1.1.25
    -   gt-i18n@0.4.2
    -   gt-react@10.11.4
    -   @generaltranslation/supported-locales@2.0.47

## @generaltranslation/gt-next-lint@11.0.5

### Patch Changes

- Updated dependencies
\[[`19ae4eb`](19ae4eb)]:
    -   gt-next@6.13.5

## gt-node@0.2.8

### Patch Changes

- Updated dependencies
\[[`dad7824`](dad7824)]:
    -   generaltranslation@8.1.14
    -   gt-i18n@0.4.2

## gt-react@10.11.4

### Patch Changes

- Updated dependencies
\[[`dad7824`](dad7824),
[`19ae4eb`](19ae4eb)]:
    -   generaltranslation@8.1.14
    -   @generaltranslation/react-core@1.5.4
    -   @generaltranslation/supported-locales@2.0.47

## @generaltranslation/react-core@1.5.4

### Patch Changes

- [#1076](#1076)
[`19ae4eb`](19ae4eb)
Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - Apply
style guide to error messages and warnings: remove "Please", simplify
verbose phrasing, fix `in-line` → `inline`.

- Updated dependencies
\[[`dad7824`](dad7824)]:
    -   generaltranslation@8.1.14
    -   gt-i18n@0.4.2
    -   @generaltranslation/supported-locales@2.0.47

## gt-sanity@1.1.21

### Patch Changes

- [#1076](#1076)
[`19ae4eb`](19ae4eb)
Thanks [@moss-bryophyta](https://github.com/moss-bryophyta)! - Apply
style guide to error messages and warnings: remove "Please", simplify
verbose phrasing, fix `in-line` → `inline`.

- Updated dependencies
\[[`dad7824`](dad7824)]:
    -   generaltranslation@8.1.14

## @generaltranslation/supported-locales@2.0.47

### Patch Changes

- Updated dependencies
\[[`dad7824`](dad7824)]:
    -   generaltranslation@8.1.14

## gt-tanstack-start@0.1.11

### Patch Changes

- Updated dependencies
\[[`dad7824`](dad7824),
[`19ae4eb`](19ae4eb)]:
    -   generaltranslation@8.1.14
    -   @generaltranslation/react-core@1.5.4
    -   gt-i18n@0.4.2
    -   gt-react@10.11.4

## gt-next-middleware-e2e@0.1.5

### Patch Changes

- Updated dependencies
\[[`19ae4eb`](19ae4eb)]:
    -   gt-next@6.13.5

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants