diff --git a/web/context/i18n.ts b/web/context/i18n.ts index 3645e25add..8a78c933fa 100644 --- a/web/context/i18n.ts +++ b/web/context/i18n.ts @@ -40,8 +40,8 @@ export const useDocLink = (baseUrl?: string): ((path?: string, pathMap?: { [inde let baseDocUrl = baseUrl || defaultDocBaseUrl baseDocUrl = (baseDocUrl.endsWith('/')) ? baseDocUrl.slice(0, -1) : baseDocUrl const { locale } = useI18N() + const docLanguage = getDocLanguage(locale) return (path?: string, pathMap?: { [index: string]: string }): string => { - const docLanguage = getDocLanguage(locale) const pathUrl = path || '' let targetPath = (pathMap) ? pathMap[locale] || pathUrl : pathUrl targetPath = (targetPath.startsWith('/')) ? targetPath.slice(0, -1) : targetPath