add getCurrentLocaleConfig utils

This commit is contained in:
sebastien 2025-07-04 13:05:30 +02:00
parent db7b2f334e
commit 98469e1099

View file

@ -115,6 +115,9 @@ export function localizePath({
return normalizeUrl([originalPath, i18n.currentLocale, '/']);
}
// TODO we may extract this to a separate package
// we want to use it on the frontend too
// but "docusaurus-utils-common" (agnostic utils) is not an ideal place since
export function getCurrentLocaleConfig(i18n: I18n): I18nLocaleConfig {
const localeConfig = i18n.localeConfigs[i18n.currentLocale];
if (!localeConfig) {