Skip to content

Commit

Permalink
fix(locales): consoles
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaPC committed Nov 3, 2023
1 parent 6f44683 commit 979307e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function LocaleDropdownNavbarItem({
* For example, if the site URL is https://example.com/docs,
* then the locale URLs will be generated as
* - EN: https://example.com/docs//docs
* - JP: https://example.com/docs/jp//docs
* - JP: https://example.com/docs/ja//docs
* The incorrect URLs will cause a 404 error.
*
* The following removes the extra slashes and the extra baseUrl (`/docs`).
Expand All @@ -49,8 +49,11 @@ export default function LocaleDropdownNavbarItem({
locale,
fullyQualified: true,
});
console.log('alternatePageUtilsUrl', alternatePageUtilsUrl);
const cleanAlternatePageUtilsUrl = alternatePageUtilsUrl.replace(/\/\/.*/, '');
console.log('cleanAlternatePageUtilsUrl', cleanAlternatePageUtilsUrl);
const baseTo = `pathname://${cleanAlternatePageUtilsUrl}`;
console.log('baseTo', baseTo);
// CUSTOM CODE - end

// preserve ?search#hash suffix on locale switches
Expand Down

0 comments on commit 979307e

Please sign in to comment.