fix: resolve localization issues and ensure English translations for UI elements

This commit is contained in:
MichalC
2026-09-18 21:49:06 +02:00
parent 4299206097
commit ab8a148823
8 changed files with 173 additions and 23 deletions
+16 -6
View File
@@ -15,7 +15,17 @@ export const ContactInfoBlock: React.FC<Props> = ({
hours = 'Pon-Pt: 9:00 - 17:00\nPo wcześniejszym umówieniu',
}) => {
const pathname = usePathname()
const isDe = pathname?.split('/').filter(Boolean)[0] === 'de'
const localeSegment = pathname?.split('/').filter(Boolean)[0]
const isDe = localeSegment === 'de'
const isEn = localeSegment === 'en'
const t = {
contactInfo: isEn ? 'Contact Information' : (isDe ? 'Kontaktinformationen' : 'Dane kontaktowe'),
address: isEn ? 'Address' : (isDe ? 'Adresse' : 'Adres'),
phone: isEn ? 'Phone' : (isDe ? 'Telefon' : 'Telefon'),
email: isEn ? 'Email' : (isDe ? 'E-Mail' : 'E-mail'),
hours: isEn ? 'Working Hours' : (isDe ? 'Öffnungszeiten' : 'Godziny pracy'),
}
return (
<section className="py-16 md:py-24 bg-background">
@@ -34,7 +44,7 @@ export const ContactInfoBlock: React.FC<Props> = ({
<div className="absolute top-0 right-0 w-12 h-12 bg-background border-l border-b border-border shadow-sm transform translate-x-6 -translate-y-6 rotate-45 pointer-events-none" />
<h2 className="font-heading text-2xl md:text-3xl font-bold text-foreground mb-10 text-center md:text-left">
{isDe ? 'Kontaktinformationen' : 'Dane kontaktowe'}
{t.contactInfo}
</h2>
<div className="grid grid-cols-1 md:grid-cols-2 gap-10 md:gap-12">
@@ -43,7 +53,7 @@ export const ContactInfoBlock: React.FC<Props> = ({
<div className="flex items-center gap-3 text-accent border-b border-border/50 pb-3">
<MapPin size={24} strokeWidth={2.5} />
<h3 className="font-heading font-bold text-lg text-foreground tracking-wide">
{isDe ? 'Adresse' : 'Adres'}
{t.address}
</h3>
</div>
<p className="text-foreground/80 leading-relaxed font-medium whitespace-pre-line text-base max-w-[65ch]">
@@ -57,7 +67,7 @@ export const ContactInfoBlock: React.FC<Props> = ({
<div className="flex items-center gap-3 text-accent border-b border-border/50 pb-3">
<Phone size={24} strokeWidth={2.5} />
<h3 className="font-heading font-bold text-lg text-foreground tracking-wide">
{isDe ? 'Telefon' : 'Telefon'}
{t.phone}
</h3>
</div>
<a
@@ -74,7 +84,7 @@ export const ContactInfoBlock: React.FC<Props> = ({
<div className="flex items-center gap-3 text-accent border-b border-border/50 pb-3">
<Mail size={24} strokeWidth={2.5} />
<h3 className="font-heading font-bold text-lg text-foreground tracking-wide">
{isDe ? 'E-Mail' : 'E-mail'}
{t.email}
</h3>
</div>
<a
@@ -91,7 +101,7 @@ export const ContactInfoBlock: React.FC<Props> = ({
<div className="flex items-center gap-3 text-accent border-b border-border/50 pb-3">
<Clock size={24} strokeWidth={2.5} />
<h3 className="font-heading font-bold text-lg text-foreground tracking-wide">
{isDe ? 'Öffnungszeiten' : 'Godziny pracy'}
{t.hours}
</h3>
</div>
<p className="text-foreground/80 leading-relaxed font-medium whitespace-pre-line text-base max-w-[65ch]">