hugo-WonderMod icon indicating copy to clipboard operation
hugo-WonderMod copied to clipboard

Hide lang switch separator if only a single lang is used

Open wrobelda opened this issue 1 year ago • 0 comments

What does this PR change? What problem does it solve?

A language switch separator is displayed even if a website has a single language only. This fixes it by checking for AllTranslations size before adding the <ul class="lang-switch"> element.

Before: Screenshot 2024-04-25 at 6 05 45 PM

After: Screenshot 2024-04-25 at 6 05 35 PM

Note that I have absolutely no experience with Golang, hopefully the is up to the standards.

PR Checklist

  • [x] I have enabled maintainer edits for this PR.
  • [x] I have verified that the code works as described/as intended.
  • [x] This change does not include any CDN resources/links.
  • [x] This change does not include any unrelated scripts such as bash and python scripts.

wrobelda avatar Apr 25 '24 16:04 wrobelda