Skip to content

Commit

Permalink
Update language dropdown display
Browse files Browse the repository at this point in the history
  • Loading branch information
YummyBacon5 authored Nov 12, 2024
1 parent 4509e0a commit 0c373cf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/app-client/src/modules/ui/layouts/app.layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,22 @@ const LanguageSwitcher: Component = () => {
const { t, getLocale, setLocale, locales } = useI18n();
const languageName = new Intl.DisplayNames(getLocale(), {
type: 'language',
languageDisplay: 'dialect',
languageDisplay: 'standard',
});

return (
<>
{locales.map(locale => (
<DropdownMenuItem onClick={() => setLocale(locale.key)} class={cn('cursor-pointer', { 'font-semibold': getLocale() === locale.key })}>
<DropdownMenuItem onClick={() => setLocale(locale.key)} class={cn('cursor-pointer', { 'font-bold': getLocale() === locale.key })}>
{languageName.of(locale.key)}
<Show when={getLocale() !== locale.key}>
{' ('}
<span translate="no" lang={locale.key}>
{locale.name}
<span class={cn('text-muted-foreground pl-1')}>
(
<span translate="no" lang={locale.key}>
{locale.name}
</span>
)
</span>
)
</Show>
</DropdownMenuItem>
))}
Expand Down

0 comments on commit 0c373cf

Please sign in to comment.