Skip to main content

Exclude Lang

The excludeLang prop allows you to exclude the localization of URLs in the menu. This is useful when you want to render menu items with URLs that are not localized. The excludeLang prop can only be used with dynamic menus.

If you are using i18n in your project, your app's pages typically reside inside the src/app/[lang] folder. However, you may also have some pages outside the src/app/[lang] folder where you don't want localization. To prevent localization of these URLs, simply add excludeLang: true to the respective menu items. By default, excludeLang is set to false, so URLs are localized unless you specify excludeLang: true.

We have implemented this prop in the horizontalMenuData.tsx file located in the src/data/navigation folder.

Props

excludeLang?: boolean
Default Value
excludeLang={false}

Example

Here we have used dynamic menu example to render the horizontal menu. You may refer to the Dynamic Menu example for more information on the dynamic menu rendering.

/horizontal-menu/menu-render/exclude-lang

Source Code