Skip to content

Language dropdown menu on mobile: paths default to locale homepage not translations of current page #2131

@chalin

Description

@chalin

Consider https://opentelemetry.io/docs/what-is-opentelemetry/, the top-nav language dropdown menu is:

<ul class="dropdown-menu">
  <li><a class="dropdown-item" href="/pt/docs/what-is-opentelemetry/">Português</a></li>
  <li><a class="dropdown-item" href="/ja/docs/what-is-opentelemetry/">日本語 (Japanese)</a></li>
  <li><a class="dropdown-item" href="/fr/docs/what-is-opentelemetry/">Français</a></li>
  <li><a class="dropdown-item" href="/es/docs/what-is-opentelemetry/">Español</a></li>
  <li><a class="dropdown-item" href="/zh/docs/what-is-opentelemetry/">中文 (Chinese)</a></li>
</ul>

The same menu on mobile, which appears in the side-nav under the hamburger, is like this when sidebar_cache_limit is set to a very low number, like 1:

<ul class="dropdown-menu">
  <li><a class="dropdown-item" href="/fr/docs/">Français</a></li>
  <li><a class="dropdown-item" href="/es/docs/">Español</a></li>
  <li><a class="dropdown-item" href="/pt/docs/">Português</a></li>
  <li><a class="dropdown-item" href="/ja/docs/">日本語 (Japanese)</a></li>
  <li><a class="dropdown-item" href="/zh/docs/">中文 (Chinese)</a></li>
</ul>

Notice that the paths all point to the locale's landing page. It might have to do with caching of partials?

/cc @svrnm @theletterf

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions