Skip to content

Add locale awareness to sidebar_menu using vue-i18n

What does this MR do and why?

Adds support for displaying the sidebar menu in the current page's language (English/Japanese).

Changes

  1. Sidebar detects language from vue-i18n
  2. Loads appropriate navigation data (en-us or ja-jp)
  3. sidebar_menu_spec.js test extended to include ja-jp/naigation.yaml
  4. ja-jp added to vue-i18n

Screenshots, screen recordings, or links to review app

Screen_Recording_2025-06-09_at_12.19.27_PM

How to set up and validate locally

  1. Configure a local GitLab Docs environment.
  2. Check out this branch.
  3. Turn Japanese on in hugo.yml - languages.ja-jp.disabled:false
  4. make view to fire up site locally
  5. Visit translated page, for example http://localhost:1313/ja-jp/topics/build_your_application/
  6. Try navigating to "CI/CD YAML構文リファレンス", which leads to http://localhost:1313/ja-jp/ci/yaml/, and it's translated.
  7. Sidebar remembers the active state.
  8. Note - with the site partially translated, many of the side bar links will lead to 404, since we don't have a fallback system in place yet.
  9. Also try navigating through the english side to ensure no regressions

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lauren Barker

Merge request reports

Loading