Skip to content

Add translated success toast for contact form#26

Open
wiatrM wants to merge 1 commit into
mainfrom
codex/add-toast/modal-on-contact-form-success
Open

Add translated success toast for contact form#26
wiatrM wants to merge 1 commit into
mainfrom
codex/add-toast/modal-on-contact-form-success

Conversation

@wiatrM

@wiatrM wiatrM commented Jul 3, 2025

Copy link
Copy Markdown
Member

Summary

  • show success toast with translations in contact forms
  • add new translation key for contact form success message

Testing

  • npm run lint
  • npm run build
  • npm test
  • npm run test:e2e (fails: Executable doesn't exist at /root/.cache/ms-playwright/...)
  • npm run type-check (fails: Missing script)
  • npm run test:a11y (fails: Missing script)
  • npm run lighthouse (fails: Chrome installation not found)

https://chatgpt.com/codex/tasks/task_e_68664ded585083258d5853ca52085f7c

Copilot AI review requested due to automatic review settings July 3, 2025 12:47
@wiatrM
wiatrM requested a review from Sebastian-Debicki as a code owner July 3, 2025 12:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a localized success message for contact form submissions and wires up translated toasts in two components.

  • Introduce contact.form.success translation key in English and Polish JSON files
  • Update defaultTranslations in LanguageContext.tsx with the new key
  • Refactor EnhancedContact and Contact components to use t('contact.form.success') and replace static toasts with translated messages

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
public/translations/pl.json Add success key under contact.form
public/translations/en.json Add success key under contact.form
contexts/LanguageContext.tsx Include success in default contact.form mapping
components/enhanced-contact.tsx Replace common.success toast with contact.form.success
components/contact.tsx Hook up useLanguage, replace static toasts with translations
Comments suppressed due to low confidence (1)

components/enhanced-contact.tsx:42

  • [nitpick] The new behavior of showing a translated success toast isn't covered by existing tests. Consider adding a unit or integration test that verifies the toast is triggered with the correct translation key after a successful submission.
        toast({ title: t('contact.form.success') });

Comment thread components/contact.tsx
setFormData({ name: '', email: '', company: '', message: '' });
} else {
toast({ title: 'Error', variant: 'destructive' });
toast({ title: t('common.error'), variant: 'destructive' });

Copilot AI Jul 3, 2025

Copy link

Choose a reason for hiding this comment

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

The translation key 'common.error' isn't defined in your JSON files or defaultTranslations, so the toast will fall back to the literal key. Either add common.error to your translation sources or use an existing key (e.g., contact.form.error).

Copilot uses AI. Check for mistakes.
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