diff --git a/docusaurus.config.js b/docusaurus.config.js index 64ccad75..f74b7b47 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -24,13 +24,13 @@ const config = { // to replace "en" with "zh-Hans". i18n: { defaultLocale: 'en', - locales: ['en', 'pr'], + locales: ['en', 'es'], localeConfigs: { en: { label: 'English', }, - pr: { - label: 'Portuguese', + es: { + label: 'EspaƱol', }, }, }, diff --git a/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx b/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx index 01835750..9a84d1a7 100644 --- a/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +++ b/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx @@ -5,9 +5,9 @@ import { useLocation } from '@docusaurus/router'; import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; import type { LinkLikeNavbarItemProps } from '@theme/NavbarItem'; import type { Props } from '@theme/NavbarItem/LocaleDropdownNavbarItem'; +import classnames from 'classnames'; export default function LocaleDropdownNavbarItem({ - // mobile, dropdownItemsBefore, dropdownItemsAfter, ...props @@ -31,9 +31,7 @@ export default function LocaleDropdownNavbarItem({ to, target: '_self', autoAddBaseUrl: false, - className: - // eslint-disable-next-line no-nested-ternary - locale === currentLocale ? 'dropdown__link--active' : '', + className: classnames({ 'dropdown__link--active': locale === currentLocale }), }; }); @@ -44,8 +42,7 @@ export default function LocaleDropdownNavbarItem({ return ( {dropdownLabel === 'English' ? 'EN' : 'PT'}} + label={<>{dropdownLabel === 'English' ? 'EN' : 'ES'}} items={items} /> );