Skip to content

feat: localize all remaining components (AnimatedStats, HealthGauge, ScanSummary, Settings, Login, Signup, Success) - #7

Merged
justAbdulaziz10 merged 1 commit into
mainfrom
claude/deadware-risk-scanner-BrMta
Feb 9, 2026
Merged

feat: localize all remaining components (AnimatedStats, HealthGauge, ScanSummary, Settings, Login, Signup, Success)#7
justAbdulaziz10 merged 1 commit into
mainfrom
claude/deadware-risk-scanner-BrMta

Conversation

@justAbdulaziz10

@justAbdulaziz10 justAbdulaziz10 commented Feb 9, 2026

Copy link
Copy Markdown
Owner

Summary by Sourcery

Localize auth, settings, summary, stats, and post-purchase UI and wire components to use the shared i18n system.

New Features:

  • Add translation keys for animated stats, health gauge, scan summary, settings panel, login, signup, and success page across all supported locales.

Enhancements:

  • Update the Translations type and existing UI components to consume localized strings via the I18nProvider instead of hardcoded English copy.

…ScanSummary, Settings, Login, Signup, Success)

Added 66 new translation keys for AnimatedStats, HealthGauge, ScanSummaryCard,
SettingsPanel, LoginForm, SignupForm, and SuccessClient. Updated all 10
non-English translation files with proper translations.

https://claude.ai/code/session_01QHfXbVLhwxwmPFAQZzPrQh
@sourcery-ai

sourcery-ai Bot commented Feb 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

Localizes all remaining user-facing UI strings for stats, health gauge, scan summary, settings, auth flows, and payment success across all supported languages and wires those translations into the corresponding React components.

Updated class diagram for Translations and localized UI components

classDiagram
  class Translations {
    +stats_ecosystems string
    +stats_risk_factors string
    +stats_replacements string
    +stats_client_side string
    +gauge_health string
    +summary_total string
    +summary_critical string
    +summary_high string
    +summary_medium string
    +summary_healthy string
    +summary_known_vulnerability string
    +summary_known_vulnerabilities string
    +summary_deprecated_package string
    +summary_deprecated_packages string
    +settings_title string
    +settings_close string
    +settings_desc string
    +settings_github_label string
    +settings_github_help string
    +settings_github_needs string
    +settings_save string
    +settings_saved string
    +settings_auth_error string
    +login_welcome string
    +login_subtitle string
    +login_email string
    +login_email_placeholder string
    +login_password string
    +login_password_placeholder string
    +login_button string
    +login_loading string
    +login_or string
    +login_github string
    +login_github_loading string
    +login_no_account string
    +signup_title string
    +signup_subtitle string
    +signup_email string
    +signup_email_placeholder string
    +signup_password string
    +signup_password_placeholder string
    +signup_button string
    +signup_loading string
    +signup_or string
    +signup_github string
    +signup_github_loading string
    +signup_has_account string
    +signup_check_email string
    +signup_confirm_sent string
    +signup_activate string
    +signup_back_login string
    +success_title string
    +success_plan_active string
    +success_unlocked string
    +success_f1 string
    +success_f2 string
    +success_f3 string
    +success_f4 string
    +success_f5 string
    +success_f6 string
    +success_f7 string
    +success_f8 string
    +success_f9 string
    +success_start string
    +success_synced string
    +success_confirming string
    +success_wait string
  }

  class I18nProvider {
    +currentLocale string
    +translations Translations
  }

  class useT {
    +t() Translations
  }

  class AnimatedStats {
    +render()
  }

  class HealthGauge {
    +score number
    +size number
    +render()
  }

  class ScanSummaryCard {
    +summary ScanSummary
    +render()
  }

  class SettingsPanel {
    +onClose() void
    +render()
  }

  class LoginForm {
    +render()
  }

  class SignupForm {
    +render()
  }

  class SuccessClient {
    +render()
  }

  I18nProvider *-- Translations
  I18nProvider ..> useT
  useT ..> Translations

  AnimatedStats ..> useT
  HealthGauge ..> useT
  ScanSummaryCard ..> useT
  SettingsPanel ..> useT
  LoginForm ..> useT
  SignupForm ..> useT
  SuccessClient ..> useT
Loading

File-Level Changes

Change Details Files
Add translation keys for stats, scan, settings, auth, and success flows to all locales and update the Translations interface accordingly.
  • Extend Translations interface with new keys for animated stats, health gauge, scan summary, settings panel, login, signup, and success page text.
  • Populate the new translation keys for all supported locales (ar, de, en, fr, hi, ja, pt, ru, zh, ko, es) using appropriate localized strings.
src/lib/i18n/types.ts
src/lib/i18n/ar.ts
src/lib/i18n/de.ts
src/lib/i18n/en.ts
src/lib/i18n/fr.ts
src/lib/i18n/hi.ts
src/lib/i18n/ja.ts
src/lib/i18n/pt.ts
src/lib/i18n/ru.ts
src/lib/i18n/zh.ts
src/lib/i18n/ko.ts
src/lib/i18n/es.ts
Wire components to use the i18n hook so that all previously hardcoded English strings are now localized.
  • Inject useT translation hook into SignupForm and replace hardcoded copy (titles, labels, placeholders, button text, status messages, and Supabase auth error) with translation keys, including use of existing nav_login/nav_signup keys for cross-link labels.
  • Inject useT into LoginForm and replace all user-facing strings (titles, labels, placeholders, button text, loading states, GitHub text, and missing-auth error) with translation keys.
  • Inject useT into SettingsPanel and localize the panel title, close label, description, GitHub token label/help text, scope note prefix, save button, and saved confirmation message.
  • Inject useT into ScanSummaryCard and localize stat labels and vulnerability/deprecated-package suffixes using singular/plural keys based on counts.
  • Inject useT into AnimatedStats to localize metric labels for ecosystems, risk factors, replacements, and client-side processing.
  • Inject useT into HealthGauge to localize the gauge label text beneath the score.
  • Update the success payment page client component to use translations for the title, plan-activated message suffix, unlocked-features heading, per-feature bullet texts, start-scanning CTA, synced-plan note, and the loading/confirming messages, including conditional team-plan-only features using separate keys.
src/app/signup/SignupForm.tsx
src/app/login/LoginForm.tsx
src/components/SettingsPanel.tsx
src/components/ScanSummaryCard.tsx
src/components/AnimatedStats.tsx
src/components/HealthGauge.tsx
src/app/success/SuccessClient.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@vercel

vercel Bot commented Feb 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
deadware-risk-scanner Ready Ready Preview, Comment Feb 9, 2026 8:15am

@justAbdulaziz10
justAbdulaziz10 merged commit 0cf6762 into main Feb 9, 2026
2 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In SuccessClient, concatenating planName with t.success_plan_active (which starts mid-sentence in several languages) makes the full sentence awkward or ungrammatical for non-English locales; consider moving planName into the translation via interpolation (e.g. success_plan_active: 'Your {{planName}} plan is now active…').
  • In SettingsPanel, the text t.settings_github_help followed by t.settings_github_needs and the hardcoded English word scope will read oddly in other languages (e.g., German/Spanish); it would be cleaner to move the entire sentence, including the scope mention, into a single localized string with a placeholder for public_repo.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `SuccessClient`, concatenating `planName` with `t.success_plan_active` (which starts mid-sentence in several languages) makes the full sentence awkward or ungrammatical for non-English locales; consider moving `planName` into the translation via interpolation (e.g. `success_plan_active: 'Your {{planName}} plan is now active…'`).
- In `SettingsPanel`, the text `t.settings_github_help` followed by `t.settings_github_needs` and the hardcoded English word `scope` will read oddly in other languages (e.g., German/Spanish); it would be cleaner to move the entire sentence, including the scope mention, into a single localized string with a placeholder for `public_repo`.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants