🌐 Added check for empty keys in context.json for i18n#27171
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds validation to the translation context generation script that scans 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
43c7df9 to
55282bf
Compare
55282bf to
cb416f2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ghost/i18n/generate-context.js`:
- Line 37: The empty-keys check in the computation of emptyKeys uses strict
equality to an empty string and misses values that are whitespace-only; update
the predicate used when filtering orderedContext to trim the value before
checking emptiness (e.g., coerce missing values to '' then call .trim()) so that
keys whose values are only whitespace are considered empty; update the filter
that defines emptyKeys (reference the orderedContext variable and the emptyKeys
constant) to use the trimmed value check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cac0e1b7-ebf0-47d4-a0be-49c84aea0118
📒 Files selected for processing (1)
ghost/i18n/generate-context.js
no ref - backfills empty i18n context hints in `context.json` - future PR will prevent empty hints from being added (#27171)
cb416f2 to
822ed04
Compare
822ed04 to
80a4771
Compare
|



no ref
testing
t('Some test string')yarn translatein ghost/i18n -- should print:Warning: 1 key(s) in context.json have empty descriptions. Please add context before committing.CI=true node generate-context.jsin ghost/i18n -- should exit with code 1 and list the keyCI=true node generate-context.jsagain -- should pass