Fix hardcoded user-facing strings (Issue #53) #54

Closed
claude wants to merge 0 commits from feature/fix-hardcoded-strings into main
Member

Summary

  • Frontend (API errors): extractApiError now checks body.code against the i18n dictionary first — Romanian users see translated messages for missing PDF, captcha failure, and cancelled requests
  • Email fallbacks: 6 new emailApi.Templates entries replace hardcoded "N/A", "Job", "Unknown", "none detected", "none", "-" in EmailApiEmailSender and CvSearchEmailSender
  • AI parse errors: 4 new cvMatcher.AiPrompts entries; CvMatcherService.ParseResult now receives language-specific messages instead of hardcoded English text

Migrations

  • email-data: AddFallbackStringTemplates — seeds 6x2 fallback template rows
  • cv-matcher-data: AddParseErrorPrompts — seeds 2x2 parse-error prompt rows

Test plan

  • Set browser to Romanian; try uploading without a file — confirm "Fisierul CV PDF lipseste." is shown
  • Trigger a match with no job URL in ro — confirm email labels use Romanian fallbacks
  • Trigger a job search session with empty keywords/no location — confirm Romanian text in scan summary email
  • Build passes: zero errors

Closes #53

## Summary - **Frontend (API errors)**: `extractApiError` now checks `body.code` against the i18n dictionary first — Romanian users see translated messages for missing PDF, captcha failure, and cancelled requests - **Email fallbacks**: 6 new `emailApi.Templates` entries replace hardcoded `"N/A"`, `"Job"`, `"Unknown"`, `"none detected"`, `"none"`, `"-"` in `EmailApiEmailSender` and `CvSearchEmailSender` - **AI parse errors**: 4 new `cvMatcher.AiPrompts` entries; `CvMatcherService.ParseResult` now receives language-specific messages instead of hardcoded English text ## Migrations - `email-data`: `AddFallbackStringTemplates` — seeds 6x2 fallback template rows - `cv-matcher-data`: `AddParseErrorPrompts` — seeds 2x2 parse-error prompt rows ## Test plan - [ ] Set browser to Romanian; try uploading without a file — confirm "Fisierul CV PDF lipseste." is shown - [ ] Trigger a match with no job URL in `ro` — confirm email labels use Romanian fallbacks - [ ] Trigger a job search session with empty keywords/no location — confirm Romanian text in scan summary email - [ ] Build passes: zero errors Closes #53
claude added 1 commit 2026-06-08 19:32:30 +00:00
- Frontend: update extractApiError to check body.code first via i18n 'error.<code>' keys;
  add en/ro translations for cv_file_missing, captcha_verification_failed, request_cancelled
- email-data migration: seed 6 fallback template keys (match N/A, subject label, unknown IP,
  job search results empty states for keywords/providers/location)
- EmailApiEmailSender: replace "N/A", "Job", "Unknown" literals with template lookups
- CvSearchEmailSender: replace "none detected", "none", "-" literals with template lookups
- cv-matcher-data migration: seed parse-error.summary and parse-error.recommendation in AiPrompts
- CvMatcherService: look up localized parse-error messages from AiPrompts before calling ParseResult

Closes #53

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gelu approved these changes 2026-06-08 19:34:16 +00:00
claude closed this pull request 2026-06-09 13:40:11 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: AI/myAi#54