Skip to content

Conversation

@stevenle
Copy link
Member

@stevenle stevenle commented Dec 3, 2025

Summary

  • add a prune_translations CLI command that inspects draft and published docs for translatable strings
  • reuse schema-aware extraction to identify unused translations tagged with a doc id and remove the tag
  • register the new command with the root-cms CLI entrypoint

Testing

  • not run (not requested)

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +133 to +143
} else if (field.type === 'array') {
const arrayKeys = fieldValue._array || [];
for (const arrayKey of arrayKeys) {
extractField(
strings,
field.of,
fieldValue[arrayKey],
types,
normalizeString
);
}

Choose a reason for hiding this comment

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

P1 Badge Skip translations stored in array fields

Array traversal relies on fieldValue._array, but pruneTranslations loads docs via cmsClient.getDoc, which unmarshals arrays into plain arrays without the _array metadata. As a result, translatable strings inside any array field are never added to docStrings, so running prune_translations on docs that contain translated arrays will incorrectly treat those strings as unused and strip their tags from the translations collection.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants