Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tracked by #2001
chalin opened this issue Nov 20, 2024 · 3 comments
Labels
e1-hours i18n Internationalization / Localization mobile p2-medium
Milestone

Comments

@chalin
Copy link
Collaborator

chalin commented Nov 20, 2024

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

@chalin chalin added e1-hours i18n Internationalization / Localization mobile p2-medium labels Nov 20, 2024
@chalin
Copy link
Collaborator Author

chalin commented Nov 20, 2024

For the record, the paths are correct (refer to translations of the current page) for the Kubernetes website. But they've implemented their own mobile-only hamburger for the top-nav: e.g., visit https://kubernetes.io/docs/concepts/ on mobile (page source). /cc @sftim

@sftim
Copy link

sftim commented Nov 20, 2024

Just so folks know, that "hamburger" menu predates Kubernetes switching to Docsy.

@sftim
Copy link

sftim commented Nov 20, 2024

Also also, partials are cached per localization in Hugo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e1-hours i18n Internationalization / Localization mobile p2-medium
Projects
None yet
Development

No branches or pull requests

2 participants