Skip to content

Conversation

@DeJeune
Copy link
Collaborator

@DeJeune DeJeune commented Jan 21, 2026

What this PR does

Before this PR:

  • Hardcoded Chinese/English UI strings could be introduced without detection
  • No automated way to identify strings that need internationalization

After this PR:

  • Added a script (scripts/check-hardcoded-strings.ts) to detect hardcoded UI strings
  • Integrated into CI workflow to check for hardcoded strings on PRs
  • Fixed multiple hardcoded strings across the codebase with proper i18n keys

Why we need it and why it was done in this way

The following tradeoffs were made:

  • The detection script uses pattern matching which may have false positives, but it's better to catch potential issues and manually review than to miss hardcoded strings

The following alternatives were considered:

  • Manual review only - rejected because it's error-prone and doesn't scale

Breaking changes

None

Special notes for your reviewer

  • The script can be run locally with pnpm i18n:hardcoded
  • Added tests for the detection patterns in scripts/__tests__/check-hardcoded-strings.test.ts

Checklist

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
  • Upgrade: Impact of this change on upgrade flows was considered and addressed if required
  • Documentation: Not required for this change

Release note

Add automated detection of hardcoded UI strings with CI integration

@DeJeune DeJeune requested a review from EurFelux January 21, 2026 11:30
@DeJeune DeJeune added this to the v1.7.14 milestone Jan 21, 2026
@EurFelux
Copy link
Collaborator

CI failed

@kangfenmao

This comment was marked as resolved.

@DeJeune DeJeune force-pushed the feat/i18n-hardcoded-string-check branch from 9a6b447 to 228c3ec Compare January 21, 2026 21:18
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.

4 participants