diff --git a/client/src/components/LanguageSwitcher.tsx b/client/src/components/LanguageSwitcher.tsx index 87d5924..02a9ba8 100644 --- a/client/src/components/LanguageSwitcher.tsx +++ b/client/src/components/LanguageSwitcher.tsx @@ -24,8 +24,13 @@ export function LanguageSwitcher() { document.documentElement.lang = langCode; // Store in localStorage for persistence localStorage.setItem('language', langCode); - // Force re-render of components - window.location.reload(); + + // Apply Arabic-specific optimizations + if (langCode === 'ar') { + document.body.classList.add('arabic-text'); + } else { + document.body.classList.remove('arabic-text'); + } }; // Initialize language on component mount diff --git a/client/src/pages/ProfessionalDirectory.tsx b/client/src/pages/ProfessionalDirectory.tsx index b586558..413a3ad 100644 --- a/client/src/pages/ProfessionalDirectory.tsx +++ b/client/src/pages/ProfessionalDirectory.tsx @@ -148,8 +148,8 @@ export default function ProfessionalDirectory() { const filteredProfessionals = mockProfessionals.filter(professional => { const matchesSearch = professional.name.toLowerCase().includes(searchTerm.toLowerCase()) || professional.specialization.toLowerCase().includes(searchTerm.toLowerCase()); - const matchesType = !selectedType || professional.type === selectedType; - const matchesLocation = !selectedLocation || professional.location === selectedLocation; + const matchesType = !selectedType || selectedType === 'all' || professional.type === selectedType; + const matchesLocation = !selectedLocation || selectedLocation === 'all' || professional.location === selectedLocation; return matchesSearch && matchesType && matchesLocation; }); @@ -368,7 +368,7 @@ export default function ProfessionalDirectory() { - {t('common.all')} + {t('common.all')} {professionalTypes.map(type => ( {t(`professionals.types.${type}`)} @@ -382,7 +382,7 @@ export default function ProfessionalDirectory() { - {t('common.all')} + {t('common.all')} {locations.map(location => ( {t(`professionals.locations.${location}`)}