import{useMemo as r}from"react";import{useLocation as l}from"react-router-dom";import{getLocaleFromPathname as c,withoutPathPrefix as n}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as m}from"../../../constants/index.js";import{useGlobalData as s}from"../useGlobalData";const E=()=>{const a=l(),{l10n:o}=s(),t=r(()=>o?.locales||[],[o?.locales]),e=o?.defaultLocale||m;return{currentLocale:r(()=>c(n(a.pathname),e,t),[a,t,e]),defaultLocale:e,locales:t}};export{E as useL10nConfig};
