Skip to content

🌐 Filled empty context descriptions and added CI guard#27176

Open
rob-ghost wants to merge 2 commits intomainfrom
fix/i18n-empty-context-descriptions
Open

🌐 Filled empty context descriptions and added CI guard#27176
rob-ghost wants to merge 2 commits intomainfrom
fix/i18n-empty-context-descriptions

Conversation

@rob-ghost
Copy link
Copy Markdown
Contributor

Summary

  • Filled in meaningful context descriptions for all 33 translation keys in context.json that previously had empty strings
  • Added a CI guard in generate-context.js that rejects empty descriptions, preventing new untranslatable keys from being merged
  • Every key now tells translators where it appears and what it does (e.g., Portal retention offer, signin email, comments UI)

CI guard

When CI=true, generate-context.js now checks for empty descriptions after validating that context.json is up to date. If any keys have empty descriptions, the script lists them and exits with a non-zero status. This runs as part of yarn translate which is already called during yarn test in the i18n package.

Test plan

  • Verify yarn workspace @tryghost/i18n test passes
  • Verify CI guard catches empty descriptions: temporarily blank a description in context.json, then run CI=true node generate-context.js from ghost/i18n/ — should fail with a list of the empty key(s)

Empty context descriptions provide no value to translators. This adds
descriptions for all 40 keys that were missing them and adds a CI guard
in generate-context.js to prevent new empty descriptions from being
merged.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ed45fbc9-1563-40ad-b14e-82c1439316ac

📥 Commits

Reviewing files that changed from the base of the PR and between a562c0e and 9d0cb8b.

📒 Files selected for processing (1)
  • ghost/i18n/generate-context.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • ghost/i18n/generate-context.js

Walkthrough

A translation context generation script now detects keys with empty descriptions and, when running in CI (process.env.CI), emits an error listing the empty keys and exits with code 1; this check runs after the "context.json out of date" check and before writing context.json. Separately, ghost/i18n/locales/context.json was updated to replace many empty description strings with descriptive text for Portal flows, errors, authentication messages, accessibility hints, and a disabled-comments state.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the two main changes: filling empty context descriptions and adding a CI guard. While it includes an emoji, it directly summarizes the core purpose of the changeset.
Description check ✅ Passed The description is directly related to the changeset, detailing the filled context descriptions, the CI guard implementation, and providing a test plan that aligns with the actual changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/i18n-empty-context-descriptions

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.

❤️ Share

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

SonarQube S4624 flags nested template literals as hard to read.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 6, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant