Skip to content

Commit

Permalink
refactor: removed need to change locale display name at multiple places
Browse files Browse the repository at this point in the history
  • Loading branch information
devilkiller-ag committed Jan 31, 2025
1 parent 18aaff7 commit ecf4f1a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/languageSelector/LanguageSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function LanguageSelect({ className = '', onChange = () => { }, o
>
{options.map((option, index) => (
<option key={index} value={option.value} data-testid='Option-form'>
{option.text.toUpperCase()}
{option.text}
</option>
))}
</select>
Expand Down
2 changes: 1 addition & 1 deletion components/navigation/MobileNavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default function MobileNavMenu({
className={`mb-4 ml-2 block w-full rounded-lg py-1 text-start text-sm font-medium leading-6 text-gray-700 transition duration-150 ease-in-out hover:bg-gray-50 ${currentLanguage.toLowerCase() === lang.text.toLowerCase() ? 'text-secondary-500' : ''}`}
data-testid='MobileNav-language-item'
>
{lang.text.toUpperCase()}
{lang.text}
</button>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/navigation/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function NavBar({ className = '', hideLogo = false }: NavBarProps
// Filter unique languages based on i18nPaths that include the modified pathnameWithoutLocale
const uniqueLangs = Object.keys(i18nPaths)
.filter((lang) => i18nPaths[lang].includes(pathnameWithoutLocale))
.map((lang) => lang.charAt(0).toUpperCase() + lang.slice(1));
.map((lang) => lang.toUpperCase());

// If no unique languages are found, default to ["EN"]
return uniqueLangs.length === 0 ? ['EN'] : uniqueLangs;
Expand Down

0 comments on commit ecf4f1a

Please sign in to comment.