You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: apply style guide to error messages and warnings (extended) (#1076)
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-line` → `inline` in CLI messages
- Simplify verbose messages while preserving meaning
- Use present tense where appropriate
### Bug fixes (from main, not yet in #1074)
- `will like fallback` → `will likely fall back`
- Capitalize sentence starts (`no locales` → `No 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)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## 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.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
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-line` → `inline`) 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
<details open><summary><h3>Confidence Score: 4/5</h3></summary>
- 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`
</details>
<details><summary><h3>Flowchart</h3></summary>
```mermaid
%%{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
```
</details>
<sub>Last reviewed commit: 134fa69</sub>
> Greptile also left **1 inline comment** on this PR.
<!-- /greptile_comment -->
---------
Co-authored-by: moss-bryophyta <261561981+moss-bryophyta@users.noreply.github.com>
Copy file name to clipboardExpand all lines: packages/cli/src/cli/base.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -599,7 +599,7 @@ See https://generaltranslation.com/en/docs/next/guides/local-tx`
599
599
constfiles: FilesOptions={};
600
600
for(constfileExtensionoffileExtensions){
601
601
constpaths=awaitpromptText({
602
-
message: `${chalk.cyan(FILE_EXT_TO_EXT_LABEL[fileExtension])}: Please enter a space-separated list of glob patterns matching the location of the ${FILE_EXT_TO_EXT_LABEL[fileExtension]} files you would like to translate.\nMake sure to include [locale] in the patterns.\nSee https://generaltranslation.com/docs/cli/reference/config#include for more information.`,
602
+
message: `${chalk.cyan(FILE_EXT_TO_EXT_LABEL[fileExtension])}: Enter a space-separated list of glob patterns matching the location of the ${FILE_EXT_TO_EXT_LABEL[fileExtension]} files you would like to translate.\nMake sure to include [locale] in the patterns.\nSee https://generaltranslation.com/docs/cli/reference/config#include for more information.`,
exportconstnoLocalesError=`No locales found! Please provide a list of locales for translation, or specify them in your gt.config.json file.`;
292
-
exportconstnoDefaultLocaleError=`No default locale found! Please provide a default locale, or specify it in your gt.config.json file.`;
293
-
exportconstnoFilesError=`Incorrect or missing files configuration! Please make sure your files are configured correctly in your gt.config.json file.`;
294
-
exportconstnoSourceFileError=`No source file found! Please double check your translations directory and default locale.`;
295
-
exportconstnoSupportedFormatError=`Unsupported data format! Please make sure your translationsDir parameter ends with a supported file extension.`;
296
-
exportconstnoApiKeyError=`No API key found! Please provide an API key using the --api-key flag or set the GT_API_KEY environment variable.`;
297
-
exportconstdevApiKeyError=`You are using a development API key. Please use a production API key to use the General Translation API.\nYou can generate a production API key with the command: npx gt auth -t production`;
298
-
exportconstnoProjectIdError=`No project ID found! Please provide a project ID using the --project-id flag, specify it in your gt.config.json file, or set the GT_PROJECT_ID environment variable.`;
299
-
exportconstnoVersionIdError=`No version ID found! Please provide a version ID using the --version-id flag or specify it in your gt.config.json file as the _versionId property.`;
300
-
exportconstinvalidConfigurationError=`Invalid files configuration! Please either provide a valid configuration to download local translations or set the --publish flag to true to upload translations to the CDN.`;
291
+
exportconstnoLocalesError=`No locales found! Provide a list of locales for translation, or specify them in your gt.config.json file.`;
292
+
exportconstnoDefaultLocaleError=`No default locale found! Provide a default locale, or specify it in your gt.config.json file.`;
293
+
exportconstnoFilesError=`Incorrect or missing files configuration! Make sure your files are configured correctly in your gt.config.json file.`;
294
+
exportconstnoSourceFileError=`No source file found! Double-check your translations directory and default locale.`;
295
+
exportconstnoSupportedFormatError=`Unsupported data format! Make sure your translationsDir parameter ends with a supported file extension.`;
296
+
exportconstnoApiKeyError=`No API key found! Provide an API key using the --api-key flag or set the GT_API_KEY environment variable.`;
297
+
exportconstdevApiKeyError=`Development API keys cannot be used with the General Translation API. Use a production API key instead.\nGenerate a production API key with: npx gt auth -t production`;
298
+
exportconstnoProjectIdError=`No project ID found! Provide a project ID using the --project-id flag, specify it in your gt.config.json file, or set the GT_PROJECT_ID environment variable.`;
299
+
exportconstnoVersionIdError=`No version ID found! Provide a version ID using the --version-id flag or specify it in your gt.config.json file as the _versionId property.`;
300
+
exportconstinvalidConfigurationError=`Invalid files configuration! Provide a valid configuration to download local translations or set the --publish flag to true to upload translations to the CDN.`;
0 commit comments