Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions components/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { toast } from '@/hooks/use-toast';
import { useLanguage } from '@/contexts/LanguageContext';

export default function Contact() {
const [formData, setFormData] = useState({
Expand All @@ -14,6 +15,7 @@ export default function Contact() {
company: '',
message: ''
});
const { t } = useLanguage();

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
Expand All @@ -34,13 +36,13 @@ export default function Contact() {
);

if (res.ok) {
toast({ title: 'Success' });
toast({ title: t('contact.form.success') });
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.
}
} catch (error) {
toast({ title: 'Error', variant: 'destructive' });
toast({ title: t('common.error'), variant: 'destructive' });
}
};

Expand Down
2 changes: 1 addition & 1 deletion components/enhanced-contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function EnhancedContact() {
);

if (res.ok) {
toast({ title: t('common.success') });
toast({ title: t('contact.form.success') });
setFormData({ name: '', email: '', company: '', message: '' });
} else {
toast({ title: t('common.error'), variant: 'destructive' });
Expand Down
3 changes: 2 additions & 1 deletion contexts/LanguageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ const defaultTranslations = {
companyPlaceholder: 'Your company',
messageRequired: 'Message *',
messagePlaceholder: 'Tell us about your project...',
submit: 'Send Message'
submit: 'Send Message',
success: 'Message sent successfully!'
},
info: {
title: 'Contact Information',
Expand Down
1 change: 1 addition & 0 deletions public/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"companyPlaceholder": "Your company",
"messagePlaceholder": "Tell us about your project...",
"submit": "Send Message"
,"success": "Message sent successfully!"
},
"info": {
"title": "Contact Information",
Expand Down
1 change: 1 addition & 0 deletions public/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@
"companyPlaceholder": "Twoja firma",
"messagePlaceholder": "Opowiedz nam o swoim projekcie...",
"submit": "Wyślij wiadomość"
,"success": "Wiadomość została wysłana pomyślnie!"
},
"info": {
"title": "Informacje kontaktowe",
Expand Down
Loading