Skip to content

feat(enrichment): i18n hardcoded-string regression analyzer #2029

Description

@JSONbored

New REES local analyzer (the i18n half of the #1499 epic 'accessibility and i18n regression' idea) that flags user-facing string literals newly added directly in JSX/UI code in a repo that otherwise uses a translation function (t('...') / i18n / FormattedMessage) — a localization regression. Detects the repo's i18n convention from the diff itself; pure compute, no network.

Deliverables

  • Add I18nFinding ({ file, line }) + i18n? key to review-enrichment/src/types.ts (no string content returned)
  • Create review-enrichment/src/analyzers/i18n-regression.ts: only activate when added lines in the PR also show an i18n call convention; then flag added JSX text nodes / user-facing string props that bypass it; skip when no i18n convention is present; cap with maxFindings
  • Register a local descriptor (category 'quality', cost 'local', requires ['files']) with inline render() in review-enrichment/src/analyzers/registry.ts
  • Add review-enrichment/test/i18n-regression.test.ts covering a hardcoded string flagged when i18n is in use, no findings when the repo shows no i18n convention, and the cap

References

  • review-enrichment/src/analyzers/iac-misconfig.ts (local line-rule template)
  • review-enrichment/src/analyzers/registry.ts:158-175
  • gh issue 1499 lists 'Accessibility and i18n regression detector' (this bounty is the i18n half; the a11y half is a separate bounty)

Part of #1499.


size: S · gittensor:feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions