mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-18 00:57:51 +02:00
add getCurrentLocaleConfig utils
This commit is contained in:
parent
db7b2f334e
commit
98469e1099
1 changed files with 3 additions and 0 deletions
|
@ -115,6 +115,9 @@ export function localizePath({
|
||||||
return normalizeUrl([originalPath, i18n.currentLocale, '/']);
|
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 {
|
export function getCurrentLocaleConfig(i18n: I18n): I18nLocaleConfig {
|
||||||
const localeConfig = i18n.localeConfigs[i18n.currentLocale];
|
const localeConfig = i18n.localeConfigs[i18n.currentLocale];
|
||||||
if (!localeConfig) {
|
if (!localeConfig) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue