Skip to content

feat: full multilingual (EN+ES) support with i18n, language switcher, and browser detection#48

Merged
adurrr merged 4 commits into
mainfrom
feat/issue-6-utility-shortcodes
Jun 10, 2026
Merged

feat: full multilingual (EN+ES) support with i18n, language switcher, and browser detection#48
adurrr merged 4 commits into
mainfrom
feat/issue-6-utility-shortcodes

Conversation

@adurrr

@adurrr adurrr commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

This PR implements full multilingual support (English + Spanish) for the Wavecast Hugo theme/module.

Changes

i18n System

  • Added with 79 translation keys covering all layout strings
  • Added with complete Spanish translations
  • Keys cover: podcast player UI, carousel, video, code copy, language switcher, site header/footer, home page, about page, schedule page, programs list, program single, episode page, program card

Spanish Content

  • Added 18 Spanish content files:
    • (home with featured episode player)
    • , ,
    • 4 program pages, 9 episode pages, 2 post pages

Language Switcher

  • New partial with:
    • Dropdown with keyboard navigation
    • ARIA attributes for accessibility
    • Per-page translation links when available
    • Fallback to language home pages

Browser Language Detection

  • Auto-detects browser language on first visit (sessionStorage guard)
  • Redirects to preferred language home page
  • Only triggers once per session

Nav Link Fixes

  • Fixed multilingual nav links for subpath-based site ()
  • Uses + menu URL path stripping
  • Works correctly for both header and footer nav

SEO

  • Added hreflang alternate links for all translations
  • Added x-default link

Code Quality

  • Replaced em-dashes with colons in Spanish content
  • Fixed language dropdown hover gap (removed 4px gap)
  • All 152 tests pass (91 JS + 39 Hugo + 22 e2e)

Testing

  • All existing tests pass
  • Added i18n test coverage: backward compat, injected translations, templates
  • Verified nav links produce correct URLs: and
  • Verified Spanish home page shows featured episode player

adurrr added 4 commits June 8, 2026 15:19
…, figure, tabs, video)

Resolves #6

- admonition (note/tip/warning/danger) with Feather SVG icons, markdown content
- button (primary/secondary/outline) with icon slot, external URL detection
- carousel: CSS scroll-snap with minimal JS prev/next buttons
- figure: HTML5 <figure> with caption, lazy loading, local+remote resources
- gallery: CSS grid thumbnails with optional :target CSS-only lightbox
- tabs/tab: CSS-only radio-button tabs, keyboard-accessible (arrow keys)
- video: HTML5 <video> with poster, caption, responsive container

Design:
- wvc- CSS prefix to avoid theme conflicts
- Dark-mode aware via [data-theme] + CSS variables
- Single assets/css/shortcodes.css for all styles
- Feather-style open-source SVG icons (MIT)
- Theme-aware code block backgrounds (slate in light/dark mode)
- Copy-to-clipboard button on all code blocks (highlight + plain pre)

Tests: 18 Hugo integration tests added (34 total, all passing)
Demo page: exampleSite/content/docs/shortcodes.md
CRITICAL fixes:
- carousel: hide prev/next buttons when 0-1 slides (C1)
- tabs: errorf when >5 tabs to prevent silent content loss (C2)
- video: fix boolean param parsing (string 'false' was truthy) (C3)
- video: auto-enforce muted when autoplay (browser requirement)
- video: auto-detect MIME type from file extension
- button: remove role=button on <a> (ARIA contract violation) (C4)

WARNING fixes:
- figure: only use target=_blank for external href links (W1)
- button, figure: add noreferrer to rel for external links (W2)
- CSS: add focus-visible outlines to all button variants (W9)
- CSS: merge duplicate figure/video caption styles (W8)
- carousel: fix usage comment (no slide shortcode exists) (I4)

Tests updated to match new behavior.
… and browser detection

- Add Hugo i18n system with 79 translation keys (en.toml + es.toml)
- Add Spanish content for all pages: home, about, contact, schedule, 4 programs, 9 episodes, 2 posts, docs
- Add language switcher dropdown with keyboard navigation and ARIA attributes
- Add browser language auto-detection (sessionStorage guard, first visit only)
- Fix nav links for subpath-based multilingual site (baseURL=/wavecast/)
- Replace hardcoded nav with menu-driven links using .Site.Home.RelPermalink
- Add hreflang alternate links for SEO
- Replace em-dashes with colons in Spanish content
- Fix language dropdown hover gap (top: 100% instead of calc(100% + 4px))
- Add Spanish home page featured episode player
- Add i18n test coverage (backward compat, injected, templates)
- All 152 tests pass (91 JS + 39 Hugo + 22 e2e)
Resolve conflicts in:
- assets/js/code-copy.js: keep i18n integration for copy button labels
- layouts/_shortcodes/carousel.html: keep i18n for aria-labels
- layouts/_shortcodes/video.html: keep i18n for unsupported video message
@adurrr adurrr merged commit a1f0520 into main Jun 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant